#228
Scrieţi un program care citeşte de la tastatură două numere naturale n şi m şi construieşte în memorie o matrice cu n linii şi m coloane care conţine numerele naturale de la 1 la m*n, dispuse astfel:
1 la m, ordonate crescător;m+1 la 2*m, ordonate descrescător;2*m+1 la 3*m, ordonate crescător;3*m+1 la 4*m, ordonate descrescător;Variante Bacalaureat 2009
| Problema | GenMat15 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64732977 | Utilizator | |
| Fișier | genmat15.cpp | Dimensiune | 361 B |
| Data încărcării | 26 Mai 2026, 17:39 | Scor/rezultat | 0 puncte |
genmat15.cpp: In function ‘int main()’: genmat15.cpp:8:16: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | if(i%2!=0){for(j=1;j<=m;j++) | ^~~ genmat15.cpp:9:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | a[i][j]=k;k++;} | ^ genmat15.cpp:10:11: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | else {for(int j=m;j>=1;j--) | ^~~ genmat15.cpp:11:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | a[i][j]=k;k++;} | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat15 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ă.