Hello, I have a "problem" when I was programing with C::B, I going to try to express me well because my mother language is Spanish.
Well, I have this code:
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout << "Inserte los datos de la matriz" << endl;
int m[4][3];
for (int i=0; i<4; i++) {
for(int j=0; j<3; j++) {
cin >> m[i][j];
}
}
for (int i=0; i<4; i++) {
for(int j=0; j<3; j++) {
cout << m[i][j];
}
cout << endl;
}
int s[3];
int con=0;
for (int i=0; i<4; i++) {
for(int j=0; j<3; j++) {
con= con+m[i][j];
}
s[i]=con;
con=0;
}
int mayor=0;
for (int i=0; i<4; i++) {
if (mayor<s[i]) {
mayor=s[i];
}
}
cout << "La fila con mayor sumatoria es " << mayor<< endl;
int fm=0;
for (int i=0; i<4; i++) {
for(int j=0; j<3; j++) {
fm= fm+m[i][j];
}
if(fm==mayor) {
for(int b=0; b<3; b++) {
cout << m[i][b];
}
}
fm=0;
}
return 0;
}
Basically shows the row where the sum of its components is higher, for example:
1 1 1
2 2 2
3 3 3
4 4 4
The row with the highest sum is 12 (4+4+4)
and then shows the row
4 4 4
Now the "problem"
C::B shows me this
(https://lh3.googleusercontent.com/t87ccIARLUVethYCCjwJpaZPj8ucw_G7-NIEUXHAUC8crxngwNZVr6DkhT1FTQwmgXnlHjyGPTWx63FgwAPsvkjIKBXXBgNtMzYnPAlQoIcEaUL-38Ll8uDViilK63D8So5IeQe8uzjHeGn_twjC_G2yMnFPGgCEHmRu_T8wgf0OW-7GR9Qp0xWX7eQpKOt44sZHKiBQW7TUWC_yDfKzRsIB1eF5FAA0suwXcEQBL0vWlOZU1Ras1_Qmo0mQZsprz0Szd7woQNrjui73VtaLPoEtIXxUt9OFXu-kcqibZUf0WuHN5GDdiEfML1MT1wCuANch25WGzs4KwRHOMEdf6TYwMDen1-1cFsDQuC5IIOhtF-X-G--8L0lYh3P-lWgwqLONEADKhQM093QIxofLDLV2Uiqgi81_pPZLlFh3w0bFJbxyUhx1WSkkj69WheRimaFB-goPabbQXMenPihmjnFO9lJ7DySMXK8v9tJ0rQFr693yHP6unhtOhuPLQiKLA3OFeXzi6PDECP71UuI8QV2SP22F5f-_roWk0GRgDgmXnRoaogT9pVCj3p7h_5SdG1wZw3aAuMa6Y4dQTD_aWc9csOaX9US5LvI2TALGKCG2ZJQXBCdmu75GHMIW_JplCSTJ7PZ4qktnXYnJOTkVifalhvcs5w0=w429-h343-no)
And Dev-C++ shows this
(https://lh3.googleusercontent.com/SoJV2oKuNppp22Qzdk_pJj_kmmBCGs4bP0-OJqly-CJL0bBg1OPC-mVcXiZStt-zwYWxbUsJtfhp8vXwfwNJZUKzV9Spa8dTPJ4qVCcdzsUBuTWDLdVyPyaQqpzpnJ6fV9nYDuBlcyZePiZEtBfMxOOa7mjNMaj5BtaCjlKRKoqYm-sa_UAjQHO8loYG5zgGFITmII8Ln_U9T1MhCRyV-DK4ZdjMhqXS-HGtqbdiVf2FdLaqXiATfjvt8WyYmNoih3RdQGMFqyWnljdEuq9ZOj61IJbAL3ENuRBt7ySy4mZAOpyKbOugJx64lZTDTQ_XVilmreoDlboP-htqnMCIvDjiAWLzQLw2m8ypY-yPA5THKcovwp4FOEl5qJBVpwRyXDpU1sj8bVUqmj78H_rNODzbWUaf3qZn1zDFUUc_taXd9epu20ls4DgPsuCiSZJfL3CYcYgOj3QIes4e0L5wEUJiy2wpMt3VhZSBXXXpIYKGXlqFFoGDfFqiaR2DrRcHJnfgu3G7zURVj2xpavt5o2WD0tYuNhxIccoWQx_v2Si40k00EipONUEqtmm-bSGb0GB-8OhQBHVVwOgqvcCaKpyrt72hObolZWjzqR5H6cq9pPnJW50sn9tsgwhg5u_S4uA-Bml4jDsSYDXq7p_umwtabjw78Uo=w454-h358-no)
Can you see that "657" in the output of C::B?
I broke my head for hours trying to find the error in my logic, but the logic is fine, so a run my code in Dev-C++, and it's ok
What is happen with C::B?? I don't understand
I want to use C::B :), but this "problem" make me lost a lot of time, I afraid that this happen again whith other code :-\