#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 | #64333242 | Utilizator | |
| Fișier | genmat31.cpp | Dimensiune | 374 B |
| Data încărcării | 30 Aprilie 2026, 09:55 | Scor/rezultat | 0 puncte |
genmat31.cpp: In function ‘int main()’: genmat31.cpp:12:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 12 | if(j=1) a[1][j]=1; | ~^~ genmat31.cpp:13:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 13 | if(i=1) a[i][1]=1; | ~^~ genmat31.cpp:14:25: warning: ‘a’ may be used uninitialized [-Wmaybe-uninitialized] 14 | a[i][j]= a[i-1][j]+a[i][j-1]; | ~~~~~~~~^ genmat31.cpp:7:14: note: ‘a’ declared here 7 | int n,i,j,a[16][16]; | ^ genmat31.cpp:14:35: warning: ‘a’ may be used uninitialized [-Wmaybe-uninitialized] 14 | a[i][j]= a[i-1][j]+a[i][j-1]; | ~~~~~~~~^ genmat31.cpp:7:14: note: ‘a’ declared here 7 | int n,i,j,a[16][16]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
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ă.