#4689
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, n];[1, n];| Problema | GenMat31 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64727382 | Utilizator | |
| Fișier | genmat31.cpp | Dimensiune | 440 B |
| Data încărcării | 26 Mai 2026, 12:23 | Scor/rezultat | Eroare de compilare |
genmat31.cpp: In function ‘int main()’: genmat31.cpp:5:9: error: ‘i’ was not declared in this scope 5 | for(i=1;i<=n;i++) | ^ genmat31.cpp:5:16: error: ‘n’ was not declared in this scope 5 | for(i=1;i<=n;i++) | ^ genmat31.cpp:7:9: error: ‘a’ was not declared in this scope 7 | a[i][1]=i; | ^ genmat31.cpp:9:9: error: ‘j’ was not declared in this scope 9 | for(j=1;j<=n;j++) | ^ genmat31.cpp:9:16: error: ‘n’ was not declared in this scope 9 | for(j=1;j<=n;j++) | ^ genmat31.cpp:11:9: error: ‘a’ was not declared in this scope 11 | a[1][j]=j; | ^ genmat31.cpp:13:9: error: ‘i’ was not declared in this scope 13 | for(i=2;i<=n;i++) | ^ genmat31.cpp:13:16: error: ‘n’ was not declared in this scope 13 | for(i=2;i<=n;i++) | ^ genmat31.cpp:15:13: error: ‘j’ was not declared in this scope 15 | for(j=2;j<=n;j++) | ^ genmat31.cpp:17:13: error: ‘a’ was not declared in this scope 17 | a[i][j]=a[i-1][j]+a[i][j-1]; | ^ genmat31.cpp:20:9: error: ‘i’ was not declared in this scope 20 | for(i=1;i<=n;i++) | ^ genmat31.cpp:20:16: error: ‘n’ was not declared in this scope 20 | for(i=1;i<=n;i++) | ^ genmat31.cpp:22:13: error: ‘j’ was not declared in this scope 22 | for(j=1;j<=n;j++) | ^ genmat31.cpp: In lambda function: genmat31.cpp:24:22: error: expected ‘{’ before ‘[’ token 24 | cout<<[i][j]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat31 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ă.