#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 | #64566326 | Utilizator | |
| Fișier | zone1.cpp | Dimensiune | 1.53 KB |
| Data încărcării | 14 Mai 2026, 16:43 | Scor/rezultat | Eroare de compilare |
zone1.cpp: In function ‘int x1(int, int)’: zone1.cpp:15:22: error: ‘sum’ was not declared in this scope 15 | return sum(i, j+1); | ^~~ zone1.cpp:17:21: error: ‘sum’ was not declared in this scope 17 | else return sum(i+1, 1); | ^~~ zone1.cpp: In function ‘int x2(int, int)’: zone1.cpp:29:33: error: ‘sum’ was not declared in this scope 29 | return a[i][j]+sum(i, j+1); | ^~~ zone1.cpp:30:22: error: ‘sum’ was not declared in this scope 30 | return sum(i, j+1); | ^~~ zone1.cpp:32:21: error: ‘sum’ was not declared in this scope 32 | else return sum(i+1, 1); | ^~~ zone1.cpp: In function ‘int x3(int, int)’: zone1.cpp:44:33: error: ‘sum’ was not declared in this scope 44 | return a[i][j]+sum(i, j+1); | ^~~ zone1.cpp:45:22: error: ‘sum’ was not declared in this scope 45 | return sum(i, j+1); | ^~~ zone1.cpp:47:21: error: ‘sum’ was not declared in this scope 47 | else return sum(i+1, 1); | ^~~ zone1.cpp: In function ‘int x4(int, int)’: zone1.cpp:59:33: error: ‘sum’ was not declared in this scope 59 | return a[i][j]+sum(i, j+1); | ^~~ zone1.cpp:60:22: error: ‘sum’ was not declared in this scope 60 | return sum(i, j+1); | ^~~ zone1.cpp:62:21: error: ‘sum’ was not declared in this scope 62 | else return sum(i+1, 1); | ^~~
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ă.