#164
Să se scrie un program care ordonează crescător elementele situate pe poziții pare într-un vector și descrescător elementele situate pe poziții impare.
| Problema | HalfSort2 | Operații I/O |
halfsort2.in/halfsort2.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64097614 | Utilizator | |
| Fișier | halfsort2.cpp | Dimensiune | 784 B |
| Data încărcării | 16 Aprilie 2026, 19:44 | Scor/rezultat | Eroare de compilare |
halfsort2.cpp: In function ‘int main()’: halfsort2.cpp:16:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 16 | for(i=2;i<=n-1;i=i+2) | ^~~ halfsort2.cpp:26:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 26 | for(i=1;i<=n-1;i=i+2) | ^~~ halfsort2.cpp:27:33: error: expected ‘)’ before ‘;’ token 27 | for(j=i+2;j<=n;j=j+2;) | ~ ^ | ) halfsort2.cpp:27:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 27 | for(j=i+2;j<=n;j=j+2;) | ^~~ halfsort2.cpp:27:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 27 | for(j=i+2;j<=n;j=j+2;) | ^ halfsort2.cpp:26:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 26 | for(i=1;i<=n-1;i=i+2) | ^~~ halfsort2.cpp:27:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 27 | for(j=i+2;j<=n;j=j+2;) | ^ halfsort2.cpp:27:34: error: expected primary-expression before ‘)’ token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema HalfSort2 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ă.