#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 | #64096881 | Utilizator | |
| Fișier | zone1.cpp | Dimensiune | 597 B |
| Data încărcării | 16 Aprilie 2026, 19:03 | Scor/rezultat | 0 puncte |
zone1.cpp: In function ‘int main()’: zone1.cpp:11:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(i<j && i+j<n+1) s1=s1+a[i][j];v[1]=s1; | ^~ zone1.cpp:11:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 11 | if(i<j && i+j<n+1) s1=s1+a[i][j];v[1]=s1; | ^ zone1.cpp:12:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 12 | if(i<j && i+j>n+1) s2=s2+a[i][j];v[2]=s2; | ^~ zone1.cpp:12:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 12 | if(i<j && i+j>n+1) s2=s2+a[i][j];v[2]=s2; | ^ zone1.cpp:13:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 13 | if(i>j && i+j>n+1) s3=s3+a[i][j];v[3]=s3; | ^~ zone1.cpp:13:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 13 | if(i>j && i+j>n+1) s3=s3+a[i][j];v[3]=s3; | ^ zone1.cpp:14:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if(i>j && i+j<n+1) s4=s4+a[i][j];v[4]=s4; | ^~ zone1.cpp:14:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 14 | if(i>j && i+j<n+1) s4=s4+a[i][j];v[4]=s4; | ^ zone1.cpp:20:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 20 | for(i=1;i<=4;i++) | ^~~ zone1.cpp:23:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 23 | return 0; | ^~~~~~ zone1.cpp:14:49: warning: array subscript 4 is above array bounds of ‘int [4]’ [-Warray-bounds=] 14 | if(i>j && i+j<n+1) s4=s4+a[i][j];v[4]=s4; | ~~~^ zone1.cpp:6:44: note: while referencing ‘v’ 6 | {int n,a[101][101],i,j,s1=0,s2=0,s3=0,s4=0,v[4]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Caught fatal signal 11 | 40 | 0 | ||
| 3 | 0.003 secunde | Caught fatal signal 11 | 40 | 0 | ||
| Punctaj total | 0 | |||||
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ă.