#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 | #64600441 | Utilizator | |
| Fișier | genmat6.cpp | Dimensiune | 1003 B |
| Data încărcării | 18 Mai 2026, 08:48 | Scor/rezultat | 0 puncte |
genmat6.cpp: In function ‘int main()’: genmat6.cpp:17:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 17 | if ( i == 1 || j == 1 && (i > j || i < j )) a[i][j] = n % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:18:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 18 | if ( i == 2 || j == 2 && (i > j || i < j )) a[i][j] = n / 10 % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:19:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 19 | if ( i == 3 || j == 3 && (i > j || i < j )) a[i][j] = n / 100 % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:20:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 20 | if ( i == 4 || j == 4 && (i > j || i < j )) a[i][j] = n / 1000 % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:21:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 21 | if ( i == 5 || j == 5 && (i > j || i < j )) a[i][j] = n / 10000 % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:22:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 22 | if ( i == 6 || j == 6 && (i > j || i < j )) a[i][j] = n / 100000 % 10; | ~~~~~~~^~~~~~~~~~~~~~~~~~~~ genmat6.cpp:12:16: warning: unused variable ‘x’ [-Wunused-variable] 12 | int i , j, x ; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
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ă.