#4696
Scrieţi un program care citeşte de la tastatură un număr natural n şi construieşte în memorie o matrice cu n linii şi n coloane în care:
1;1;| Problema | GenMat32 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64727892 | Utilizator | |
| Fișier | genmat32.cpp | Dimensiune | 366 B |
| Data încărcării | 26 Mai 2026, 12:39 | Scor/rezultat | Eroare de compilare |
genmat32.cpp: In function ‘int main()’: genmat32.cpp:5:5: warning: variable ‘a’ set but not used [-Wunused-but-set-variable] 5 | int a[100][100], n, i, j; | ^ genmat32.cpp:5:21: warning: unused variable ‘i’ [-Wunused-variable] 5 | int a[100][100], n, i, j; | ^ genmat32.cpp: At global scope: genmat32.cpp:12:1: error: expected unqualified-id before ‘for’ 12 | for ( i=n-1; i>=1; i--) | ^~~ genmat32.cpp:12:14: error: ‘i’ does not name a type 12 | for ( i=n-1; i>=1; i--) | ^ genmat32.cpp:12:20: error: ‘i’ does not name a type 12 | for ( i=n-1; i>=1; i--) | ^ genmat32.cpp:16:1: error: expected unqualified-id before ‘for’ 16 | for ( j=n-1; j>=1; j--) | ^~~ genmat32.cpp:16:14: error: ‘j’ does not name a type 16 | for ( j=n-1; j>=1; j--) | ^ genmat32.cpp:16:20: error: ‘j’ does not name a type 16 | for ( j=n-1; j>=1; j--) | ^ genmat32.cpp:20:1: error: expected unqualified-id before ‘for’ 20 | for (i=1; i<=n; i++) | ^~~ genmat32.cpp:20:11: error: ‘i’ does not name a type 20 | for (i=1; i<=n; i++) | ^ genmat32.cpp:20:17: error: ‘i’ does not name a type 20 | for (i=1; i<=n; i++) | ^ genmat32.cpp:28:1: error: expected declaration before ‘}’ token 28 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat32 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ă.