Errores en el compilador dev c++
Publicado por Jonathan Bazán López (1 intervención) el 24/03/2019 20:57:16
Hola tengo un problema que a la hora de compilar los programas me salen errores y abre una pestaña. No compila, tiene poco de esto y los programas están bien.
anexo codigo:suma de dos matrices de 3x3
------------------------------------------------------------------------------------------------------------------------
Anexo imagenes
Gracias por su atención.
anexo codigo:suma de dos matrices de 3x3
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
#include <iostream>
#define COL 3
#define FIL 3
using namespace std;
class Matriz{
private:
int mA[FIL][COL];
int mB[FIL][COL];
int mR[FIL][COL];
public:
Matriz(){
for(int i=0; i<FIL; i++){ //Filas
for (int j=0; j<COL;j++){ //Columnas
mA[i][j] = 0;
mB[i][j] = 0;
mR[i][j] = 0;
}
}
}
int obtenerDato (int f, int c){
return mR[f][c];
}
void guardarDatoA(int dato, int f, int c){
mA[f][c]=dato;
}
void guardarDatoB(int dato, int f, int c){
mB[f][c]=dato;
}
void suma(){
for(int i=0; i<FIL; i++){ //Filas
for (int j=0; j<COL;j++){ //Columnas
mR[i][j] = mA[i][j] + mB[i][j];
}
}
}
};
class Interfaz{
private:
Matriz mat;
public:
void mostrar(){
mat.suma();
for(int i=0; i<FIL; i++){ //Filas
cout << " ";
for (int j=0; j<COL;j++){ //Columnas
cout << mat.obtenerDato(i,j) << " ";
}
cout << endl;
}
}
void pedirDatosA(){
int x;
for(int i=0; i<FIL; i++){ //Filas
for (int j=0; j<COL;j++){ //Columnas
cout << "["<<i<<"]["<<j<<"]: ";
cin >> x;
mat.guardarDatoA(x,i,j);
}
}
}
void pedirDatosB(){
int x;
for(int i=0; i<FIL; i++){ //Filas
for (int j=0; j<COL;j++){ //Columnas
cout << "["<<i<<"]["<<j<<"]: ";
cin >> x;
mat.guardarDatoB(x,i,j);
}
}
}
};
main(){
Interfaz inter;
inter.pedirDatosA();
inter.pedirDatosB();
inter.mostrar();
}
------------------------------------------------------------------------------------------------------------------------
Anexo imagenes
Gracias por su atención.
Valora esta pregunta
0