#781
Zone1
Se dă o matrice cu n
linii şi n
coloane şi elemente numere naturale. Să se afişeze, în ordine crescătoare, sumele elementelor din cele patru zone delimitate de diagonale.
Problema | Zone1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57290782 | Utilizator | |
Fișier | zone1.cpp | Dimensiune | 741 B |
Data încărcării | 24 Martie 2025, 15:52 | Scor / rezultat | Eroare de compilare |
zone1.cpp: In function 'int main()': zone1.cpp:9:20: error: 'm' was not declared in this scope for(j = 0; j < m; j++) ^ zone1.cpp:6:29: warning: unused variable 'N' [-Wunused-variable] { int n, i, j, a[100][100], N = 0, S = 0, V = 0, E = 0; ^ zone1.cpp:6:36: warning: unused variable 'S' [-Wunused-variable] { int n, i, j, a[100][100], N = 0, S = 0, V = 0, E = 0; ^ zone1.cpp:6:43: warning: unused variable 'V' [-Wunused-variable] { int n, i, j, a[100][100], N = 0, S = 0, V = 0, E = 0; ^ zone1.cpp:6:50: warning: unused variable 'E' [-Wunused-variable] { int n, i, j, a[100][100], N = 0, S = 0, V = 0, E = 0; ^ zone1.cpp: At global scope: zone1.cpp:11:9: error: expected unqualified-id before 'for' for(i = 0; j < n; j++){ ^ zone1.cpp:11:20: error: 'j' does not name a type for(i = 0; j < n; j++){ ^ zone1.cpp:11:27: error: 'j' does not name a type for(i = 0; j < n; j++){ ^ zone1.cpp:21:13: error: 'N' was not declared in this scope int V[4] = {N, S, E, V}; ^ zone1.cpp:21:16: error: 'S' was not declared in this scope int V[4] = {N, S, E, V}; ^ zone1.cpp:21:19: error: 'E' was not declared in this scope int V[4] = {N, S, E, V}; ^ zone1.cpp:22:1: error: expected unqualified-id before 'for' for(i = 0; i < 4 - i; j++) ^ zone1.cpp:22:12: error: 'i' does not name a type for(i = 0; i < 4 - i; j++) ^ zone1.cpp:22:23: error: 'j' does not name a type for(i = 0; i < 4 - i; j++) ^ zone1.cpp:23:19: error: 'j' does not name a type for(j =i + 1; j < 4; j++) ^ zone1.cpp:23:26: error: 'j' does not name a type for(j =i + 1; j < 4; j++) ^ zone1.cpp:26:9: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Zone1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.