#512
Se dă un vector cu n elemente, numere naturale distincte. Ordonați crescător elementele situate înaintea valorii maxime din vector și descrescător elementele situate după această valoare.
| Problema | SortMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64233081 | Utilizator | |
| Fișier | sortmax.cpp | Dimensiune | 866 B |
| Data încărcării | 24 Aprilie 2026, 11:39 | Scor/rezultat | Eroare de compilare |
sortmax.cpp: In function ‘int main()’: sortmax.cpp:48:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 48 | for(i=0;i<n;i++) | ^~~ sortmax.cpp:50:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 50 | return 0; | ^~~~~~ sortmax.cpp: At global scope: sortmax.cpp:52:4: error: expected declaration before ‘}’ token 52 | } | ^ sortmax.cpp:53:4: error: expected unqualified-id before ‘for’ 53 | for(i=0;i<n;i++) | ^~~ sortmax.cpp:53:12: error: ‘i’ does not name a type 53 | for(i=0;i<n;i++) | ^ sortmax.cpp:53:16: error: ‘i’ does not name a type 53 | for(i=0;i<n;i++) | ^ sortmax.cpp:55:5: error: expected unqualified-id before ‘return’ 55 | return 0; | ^~~~~~ sortmax.cpp:56:1: error: expected declaration before ‘}’ token 56 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortMax 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ă.