#207
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 ale cărei elemente vor primi valori după cum urmează:
0nn-11Variante Bacalaureat 2009
| Problema | GenMat2 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64945893 | Utilizator | |
| Fișier | genmat2.cpp | Dimensiune | 259 B |
| Data încărcării | 20 Iunie 2026, 13:04 | Scor/rezultat | 100 puncte |
genmat2.cpp: In function ‘int main()’: genmat2.cpp:9:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | if(i!=j) | ^~ genmat2.cpp:10:12: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 10 | v[i][j]=n; n--;} | ^ genmat2.cpp:12:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | {for(j=1;j<=n1;j++) | ^~~ genmat2.cpp:13:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | cout<<v[i][j]<<" "; cout<<endl;} | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat2 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ă.