#215
Scrieţi un program care citeşte de la tastatură un număr natural nenul n cu exact 5 cifre şi construieşte un tablou bidimensional completat cu cifrele numărului citit, după o regulă precizată.
Variante Bacalaureat 2009
| Problema | GenMat6 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64621705 | Utilizator | |
| Fișier | genmat6.cpp | Dimensiune | 441 B |
| Data încărcării | 19 Mai 2026, 08:38 | Scor/rezultat | Eroare de compilare |
genmat6.cpp: In function ‘int main()’: genmat6.cpp:13:28: error: expected ‘}’ before ‘else’ 13 | else if ((i+j>n+1 && i<j)||(i+j>n+1 && i>j)) | ^~~~ genmat6.cpp:11:44: note: to match this ‘{’ 11 | if(n+1==i+j||i==j) { | ^ genmat6.cpp:6:25: warning: unused variable ‘m’ [-Wunused-variable] 6 | int a[25][25],i,m,n,j,k; | ^ genmat6.cpp: At global scope: genmat6.cpp:22:25: error: ‘cout’ does not name a type 22 | cout<<a[i][j]<<' '; | ^~~~ genmat6.cpp:23:17: error: expected declaration before ‘}’ token 23 | } | ^ genmat6.cpp:24:17: error: ‘cout’ does not name a type 24 | cout<<endl; | ^~~~ genmat6.cpp:25:9: error: expected declaration before ‘}’ token 25 | } | ^ genmat6.cpp:32:9: error: expected unqualified-id before ‘return’ 32 | return 0; | ^~~~~~ genmat6.cpp:33:1: error: expected declaration before ‘}’ token 33 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat6 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ă.