#2822
Scrieți un program care citește de la tastatură un număr natural, n (n∈[2,102]), și construiește în memorie un tablou bidimensional, cu n linii și n coloane, astfel:
[1,n];n;Subiect Bacalaureat 2016, sesiunea iunie-iulie
| Problema | GenMat25 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64103627 | Utilizator | |
| Fișier | genmat25.cpp | Dimensiune | 408 B |
| Data încărcării | 17 Aprilie 2026, 09:21 | Scor/rezultat | Eroare de compilare |
genmat25.cpp:5:3: error: expected initializer before ‘for’ 5 | for(i=1; i<=n; i++) | ^~~ genmat25.cpp:5:12: error: ‘i’ does not name a type 5 | for(i=1; i<=n; i++) | ^ genmat25.cpp:5:18: error: ‘i’ does not name a type 5 | for(i=1; i<=n; i++) | ^ genmat25.cpp:6:15: error: ‘j’ does not name a type 6 | for(j=1; j<=n; j++) | ^ genmat25.cpp:6:21: error: ‘j’ does not name a type 6 | for(j=1; j<=n; j++) | ^ genmat25.cpp:11:3: error: expected unqualified-id before ‘for’ 11 | for(j=2; j<=n; j++) | ^~~ genmat25.cpp:11:12: error: ‘j’ does not name a type 11 | for(j=2; j<=n; j++) | ^ genmat25.cpp:11:18: error: ‘j’ does not name a type 11 | for(j=2; j<=n; j++) | ^ genmat25.cpp:12:14: error: ‘i’ does not name a type 12 | for(i=1; i<=n; i++) | ^ genmat25.cpp:12:20: error: ‘i’ does not name a type 12 | for(i=1; i<=n; i++) | ^ genmat25.cpp:14:3: error: expected unqualified-id before ‘for’ 14 | for(i=1; i<=n; i++) | ^~~ genmat25.cpp:14:12: error: ‘i’ does not name a type 14 | for(i=1; i<=n; i++) | ^ genmat25.cpp:14:18: error: ‘i’ does not name a type 14 | for(i=1; i<=n; i++) | ^ genmat25.cpp:18:3: error: expected unqualified-id before ‘return’ 18 | return 0; | ^~~~~~ genmat25.cpp:19:1: error: expected declaration before ‘}’ token 19 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat25 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ă.