@rpichioli/

Some loops and matrix - Incomplete

C++

Trying to use conio.c and conio.h libraries to build a graphical app that compares arrays/matrix.

fork
loading
Files
  • main.cpp
  • conio.c
  • conio.h

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9310653497278987","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPHN0ZGlvLmg+Ci8vI2luY2x1ZGUgPGNvbmlvLmg+Ci8vI2luY2x1ZGUgPGNvbmlvLmM+CgppbnQgbWFpbigpewoJLy90ZXh0YmFja2dyb3VuZChXSElURSk7IGNscnNjcigpOwogICAgLy90ZXh0Y29sb3IoQkxBQ0spO3RleHRiYWNrZ3JvdW5kKFdISVRFKTsKICAgIAoJaW50IEFbNV1bM10sQls1XVszXSxDWzVdWzNdLHgseSx2YWwxLHZhbDIsY29uc3RBPTMsY29uc3RCPTI2LGNvbnN0Qz00OTsKCQoJLy9nb3RveHkoMjMsMSk7CglwcmludGYoIlByb2dyYW1hIFNvbWEgTWF0cml6ZXMiKTsKCQoJZm9yKHg9MTt4PDY7eCsrKXsKCQlmb3IoeT0xO3k8NDt5KyspewogICAgICAgICAgICBBW3hdW3ldPTA7CgkJfQoJfQoKCWZvcih4PTE7eDw2O3grKyl7CgkJZm9yKHk9MTt5PDQ7eSsrKXsKICAgICAgICAgICAgQVt4XVt5XT0wOwoJCX0KCX0KCQoJLy9nb3RveHkoOSwyKTsKCXByaW50ZigiQSIpOwoJLy9nb3RveHkoMzIsMik7CglwcmludGYoIkIiKTsKCS8vZ290b3h5KDU1LDIpOwoJcHJpbnRmKCJTIik7CgkKCS8vZ290b3h5KGNvbnN0QS0yLDMpO3RleHRiYWNrZ3JvdW5kKFlFTExPVyk7CglwcmludGYoIlsgICAgXVsgICAgXVsgICAgXSIpOwoJLy9nb3RveHkoY29uc3RBLTIsNCk7dGV4dGJhY2tncm91bmQoWUVMTE9XKTsKCXByaW50ZigiWyAgICBdWyAgICBdWyAgICBdIik7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nb3RveHkoY29uc3RDKzYseCsyKTt0ZXh0Y29sb3IoV0hJVEUpO3RleHRiYWNrZ3JvdW5kKFJFRCk7CgkJCQlwcmludGYoIiVkIixDW3hdW3ldKTsKICAgICAgICAgICAgfSAKICAgICAgICAgICAgaWYoeT09Myl7CiAgICAgICAgICAgICAgICAvL2dvdG94eShjb25zdEMrMTIseCsyKTt0ZXh0Y29sb3IoV0hJVEUpO3RleHRiYWNrZ3JvdW5kKFJFRCk7CgkJCQlwcmludGYoIiVkIixDW3hdW3ldKTsKICAgICAgICAgICAgfSAKCQl9Cgl9CQogICAgLy9nZXRjaCgpOyAgICAKfQo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include <stdio.h>
//#include <conio.h>
//#include <conio.c>

int main(){
	//textbackground(WHITE); clrscr();
    //textcolor(BLACK);textbackground(WHITE);
    
	int A[5][3],B[5][3],C[5][3],x,y,val1,val2,constA=3,constB=26,constC=49;
	
	//gotoxy(23,1);
	printf("Programa Soma Matrizes");
	
	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
            A[x][y]=0;
		}
	}

	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
            A[x][y]=0;
		}
	}
	
	//gotoxy(9,2);
	printf("A");
	//gotoxy(32,2);
	printf("B");
	//gotoxy(55,2);
	printf("S");
	
	//gotoxy(constA-2,3);textbackground(YELLOW);
	printf("[    ][    ][    ]");
	//gotoxy(constA-2,4);textbackground(YELLOW);
	printf("[    ][    ][    ]");
	//gotoxy(constA-2,5);textbackground(YELLOW);
	printf("[    ][    ][    ]");
	//gotoxy(constA-2,6);textbackground(YELLOW);
	printf("[    ][    ][    ]");
	//gotoxy(constA-2,7);textbackground(YELLOW);
	printf("[    ][    ][    ]");
	
	//gotoxy(21,5);textbackground(WHITE);
	printf("+");
	
	//gotoxy(constB-2,3);textbackground(CYAN);
	printf("[    ][    ][    ]");
	//gotoxy(constB-2,4);textbackground(CYAN);
	printf("[    ][    ][    ]");
	//gotoxy(constB-2,5);textbackground(CYAN);
	printf("[    ][    ][    ]");
	//gotoxy(constB-2,6);textbackground(CYAN);
	printf("[    ][    ][    ]");
	//gotoxy(constB-2,7);textbackground(CYAN);
	printf("[    ][    ][    ]");
	
	//gotoxy(44,5);textbackground(WHITE);
	printf("=");
	
	//gotoxy(constC-2,3);textcolor(WHITE);textbackground(RED);
	printf("[    ][    ][    ]");
	//gotoxy(constC-2,4);textcolor(WHITE);textbackground(RED);
	printf("[    ][    ][    ]");
	//gotoxy(constC-2,5);textcolor(WHITE);textbackground(RED);
	printf("[    ][    ][    ]");
	//gotoxy(constC-2,6);textcolor(WHITE);textbackground(RED);
	printf("[    ][    ][    ]");
	//gotoxy(constC-2,7);textcolor(WHITE);textbackground(RED);
	printf("[    ][    ][    ]");
	
	//gotoxy(14,15);textbackground(BLACK);textcolor(WHITE);
	printf("Desenvolvido por Rodrigo e Jefferson...");
	
	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
			if(y==1){
                //gotoxy(constA,x+2);textcolor(BLACK);textbackground(YELLOW);
				scanf("%d",&val1);A[x][y]=val1;
            }    
            if(y==2){
                //gotoxy(constA+6,x+2);textcolor(BLACK);textbackground(YELLOW);
				scanf("%d",&val1);A[x][y]=val1;
            } 
            if(y==3){
                //gotoxy(constA+12,x+2);textcolor(BLACK);textbackground(YELLOW);
				scanf("%d",&val1);A[x][y]=val1;
            } 
		}
	}

	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
			if(y==1){
                //gotoxy(constB,x+2);textbackground(CYAN);
				scanf("%d",&val2);B[x][y]=val2;
            }    
            if(y==2){
                //gotoxy(constB+6,x+2);textbackground(CYAN);
				scanf("%d",&val2);B[x][y]=val2;
            } 
            if(y==3){
                //gotoxy(constB+12,x+2);textbackground(CYAN);
				scanf("%d",&val2);B[x][y]=val2;
            } 
		}
	}
	
	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
			C[x][y]=A[x][y]+B[x][y]; 
		}
	}
	
	for(x=1;x<6;x++){
		for(y=1;y<4;y++){
			if(y==1){
                //gotoxy(constC,x+2);textcolor(WHITE);textbackground(RED);
				printf("%d",C[x][y]);
            }    
            if(y==2){
                //gotoxy(constC+6,x+2);textcolor(WHITE);textbackground(RED);
				printf("%d",C[x][y]);
            } 
            if(y==3){
                //gotoxy(constC+12,x+2);textcolor(WHITE);textbackground(RED);
				printf("%d",C[x][y]);
            } 
		}
	}	
    //getch();    
}