#781
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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64445230 | Utilizator | |
| Fișier | zone1.cpp | Dimensiune | 674 B |
| Data încărcării | 07 Mai 2026, 11:05 | Scor/rezultat | Eroare de compilare |
zone1.cpp: In function ‘int main()’: zone1.cpp:14:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if(i<j && i+j<n+1) | ^~ zone1.cpp:16:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | v[1]=s1; | ^ zone1.cpp:16:17: error: ‘v’ was not declared in this scope zone1.cpp:17:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 17 | if(i<j && i+j>n+1) | ^~ zone1.cpp:19:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 19 | v[2]=s2; | ^ zone1.cpp:20:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 20 | if(i>j && i+j>n+1) | ^~ zone1.cpp:22:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 22 | v[3]=s3; | ^ zone1.cpp:23:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 23 | if(i>j && i+j<n+1) | ^~ zone1.cpp:25:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 25 | v[4]=s4 | ^ zone1.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1; i<=n; i++) | ^~~ zone1.cpp:28:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 28 | cout<<s; | ^~~~ zone1.cpp:28:15: error: ‘s’ was not declared in this scope 28 | cout<<s; | ^
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ă.