#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 | #64544657 | Utilizator | |
| Fișier | genmat4.cpp | Dimensiune | 370 B |
| Data încărcării | 13 Mai 2026, 13:30 | Scor/rezultat | Eroare de compilare |
genmat4.cpp: In function ‘int main()’: genmat4.cpp:11:18: error: invalid operands of types ‘int [25][25]’ and ‘int’ to binary ‘operator*’ 11 | a[i][j]=a*i+n/j; | ~^~ | | | | | int | int [25][25] genmat4.cpp:10:8: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(j=1;j<=n;j++) | ^~~ genmat4.cpp:13:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | for(i=1;i<=n;i++) | ^~~ genmat4.cpp:15:29: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 15 | a[i][j]= i * j (1<=i<=n & 1<=j<=n); | ~^~~ genmat4.cpp:15:39: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 15 | a[i][j]= i * j (1<=i<=n & 1<=j<=n); | ~^~~ genmat4.cpp:15:32: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] 15 | a[i][j]= i * j (1<=i<=n & 1<=j<=n); | ~~~~^~~ genmat4.cpp:15:27: error: ‘j’ cannot be used as a function 15 | a[i][j]= i * j (1<=i<=n & 1<=j<=n); | ~~^~~~~~~~~~~~~~~~~~~ genmat4.cpp:6:11: warning: unused variable ‘m’ [-Wunused-variable] 6 | int n,m,i,j; | ^
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ă.