#509
Să se scrie un program care ordonează crescător elementele unui vector.
| Problema | Ordonare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64143286 | Utilizator | |
| Fișier | ordonare.cpp | Dimensiune | 386 B |
| Data încărcării | 20 Aprilie 2026, 11:11 | Scor/rezultat | Eroare de compilare |
ordonare.cpp: In function ‘int main()’: ordonare.cpp:16:21: warning: unused variable ‘aux’ [-Wunused-variable] 16 | int aux = v[i]; | ^~~ ordonare.cpp:15:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if(v[i]>v[j]) | ^~ ordonare.cpp:17:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 17 | v[i] = v[j]; | ^ ordonare.cpp:18:24: error: ‘aux’ was not declared in this scope 18 | v[j] = aux; | ^~~ ordonare.cpp: At global scope: ordonare.cpp:22:5: error: expected unqualified-id before ‘return’ 22 | return 0; | ^~~~~~ ordonare.cpp:23:1: error: expected declaration before ‘}’ token 23 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ordonare 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ă.