#4678
Vi se dă o matrice cu n linii și m coloane care memorează numere naturale. Să se reordoneze elementele de pe fiecare linie astfel încât numerele impare să se afle în ordine crescătoare la începutul liniei, iar numerele pare, de asemenea în ordine crescătoare, la sfârșitul liniei.
Folclorul informatic
| Problema | MatrixReord | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64574891 | Utilizator | |
| Fișier | matrixreord.cpp | Dimensiune | 1.10 KB |
| Data încărcării | 15 Mai 2026, 10:44 | Scor/rezultat | Eroare de compilare |
matrixreord.cpp:7:20: error: stray ‘\’ in program 7 | for(int j=0\i+1;j<n;j++) | ^ matrixreord.cpp: In function ‘void ordoneaza(int*, int)’: matrixreord.cpp:7:20: error: expected ‘;’ before ‘i’ 7 | for(int j=0\i+1;j<n;j++) | ^~ | ; matrixreord.cpp:7:26: warning: for increment expression has no effect [-Wunused-value] 7 | for(int j=0\i+1;j<n;j++) | ~^~ matrixreord.cpp:7:28: error: expected ‘)’ before ‘;’ token 7 | for(int j=0\i+1;j<n;j++) | ~ ^ | ) matrixreord.cpp:7:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for(int j=0\i+1;j<n;j++) | ^~~ matrixreord.cpp:7:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 7 | for(int j=0\i+1;j<n;j++) | ^ matrixreord.cpp:6:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(int i=0;i<n-1;i++) | ^~~ matrixreord.cpp:7:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 7 | for(int j=0\i+1;j<n;j++) | ^ matrixreord.cpp:7:29: error: ‘j’ was not declared in this scope
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatrixReord 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ă.