#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 | #64327188 | Utilizator | |
| Fișier | ordonare.cpp | Dimensiune | 314 B |
| Data încărcării | 29 Aprilie 2026, 20:11 | Scor/rezultat | Eroare de compilare |
ordonare.cpp:11:38: error: empty character constant 11 | for (i=1; i<=n; i++) cout<<v[i]; ''; | ^~ ordonare.cpp: In function ‘int main()’: ordonare.cpp:6:16: warning: left operand of comma operator has no effect [-Wunused-value] 6 | for (i=1; i<=n, i++) cin v[i] | ~^~~ ordonare.cpp:6:24: error: expected ‘;’ before ‘)’ token 6 | for (i=1; i<=n, i++) cin v[i] | ^ | ; ordonare.cpp:6:29: error: expected ‘;’ before ‘v’ 6 | for (i=1; i<=n, i++) cin v[i] | ^~ | ; ordonare.cpp:6:26: warning: statement has no effect [-Wunused-value] 6 | for (i=1; i<=n, i++) cin v[i] | ^~~ ordonare.cpp:7:20: warning: statement has no effect [-Wunused-value] 7 | for (i=1; i<n; i++) | ~^~ ordonare.cpp:7:27: error: expected ‘;’ before ‘)’ token 7 | for (i=1; i<n; i++) | ^ | ; ordonare.cpp:8:22: warning: statement has no effect [-Wunused-value] 8 | for (j=i+1; j<=n; j++) | ~^~~ ordonare.cpp:8:30: error: expected ‘;’ before ‘)’ token 8 | for (j=i+1; j<=n; j++) | ^ | ; ordonare.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for (i=1; i<=n; i++) cout<<v[i]; ''; | ^~~ ordonare.cpp:11:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for (i=1; i<=n; i++) cout<<v[i]; ''; | ^~ ordonare.cpp:11:38: warning: statement has no effect [-Wunused-value] ordonare.cpp:11:41: error: expected ‘}’ at end of input 11 | for (i=1; i<=n; i++) cout<<v[i]; ''; | ^ ordonare.cpp:3:13: note: to match this ‘{’ 3 | int main () { | ^ ordonare.cpp:4:23: warning: unused variable ‘aux’ [-Wunused-variable] 4 | int v[100], i, n, aux, j; | ^~~
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ă.