#213
Scrieţi un program care citeşte de la tastatură un număr natural nenul n construieşte un tablou bidimensional de dimensiune n în care fiecare element este egal cu ultima cifră a produsului indicilor.
Variante Bacalaureat 2009
| Problema | GenMat4 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64618748 | Utilizator | |
| Fișier | genmat4.cpp | Dimensiune | 395 B |
| Data încărcării | 18 Mai 2026, 21:47 | Scor/rezultat | Eroare de compilare |
genmat4.cpp: In function ‘int main()’: genmat4.cpp:8:19: error: expected ‘;’ before ‘}’ token 8 | { cin >> a[i][j] | ^ | ; 9 | } | ~ genmat4.cpp:11:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | { if(m%10==ultimcif); | ^~ genmat4.cpp:12:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 12 | a[i][j]=a[i][ultimcif]; | ^ genmat4.cpp:13:3: error: expected ‘}’ before ‘else’ 13 | else | ^~~~ genmat4.cpp:11:2: note: to match this ‘{’ 11 | { if(m%10==ultimcif); | ^ genmat4.cpp:5:13: warning: unused variable ‘n’ [-Wunused-variable] 5 | { int i, j, n, m, a[30][30], ultimcif; | ^ genmat4.cpp: At global scope: genmat4.cpp:16:4: error: expected unqualified-id before ‘for’ 16 | for(i=4; i<=30; i++) | ^~~ genmat4.cpp:16:13: error: ‘i’ does not name a type 16 | for(i=4; i<=30; i++) | ^ genmat4.cpp:16:20: error: ‘i’ does not name a type 16 | for(i=4; i<=30; i++) | ^ genmat4.cpp:17:16: error: ‘i’ does not name a type 17 | for(i=4; i<=30; i++) | ^ genmat4.cpp:17:23: error: ‘i’ does not name a type 17 | for(i=4; i<=30; i++) | ^ genmat4.cpp:20:2: error: ‘cout’ does not name a type 20 | cout <<'\n'; | ^~~~ genmat4.cpp:21:1: error: expected declaration before ‘}’ token 21 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat4 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ă.