#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 | #64739810 | Utilizator | |
| Fișier | zone1.cpp | Dimensiune | 1.19 KB |
| Data încărcării | 27 Mai 2026, 08:48 | Scor/rezultat | 100 puncte |
zone1.cpp: In function ‘void produs(int (*)[201], int, int*)’: 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 | t[1]=s; | ^ 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 | t[2]=s; | ^ zone1.cpp:29:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 29 | if(i<j && i+j<n+1) | ^~ zone1.cpp:31:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 31 | t[3]=s; | ^ zone1.cpp:35:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 35 | if(i>j && i+j<n+1) | ^~ zone1.cpp:37:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 37 | t[4]=s; | ^ zone1.cpp: In function ‘int main()’: zone1.cpp:52:21: warning: iteration 3 invokes undefined behavior [-Waggressive-loop-optimizations] 52 | cout<<t[i]<<" "; | ^~~ zone1.cpp:51:18: note: within this loop 51 | for(int i=1;i<=4;i++) | ~^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.002 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
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ă.