#4146
Se dă un vector cu n elemente, numere naturale. Afișați în ordine descrescătoare valorile divizibile cu 10 din acest vector.
| Problema | Sort10 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64636997 | Utilizator | |
| Fișier | sort10.cpp | Dimensiune | 440 B |
| Data încărcării | 19 Mai 2026, 18:38 | Scor/rezultat | Eroare de compilare |
sort10.cpp: In function ‘int main()’: sort10.cpp:11:16: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 11 | if(v[i]<v[i+1] | ^ sort10.cpp:11:27: error: expected ‘;’ before ‘swap’ 11 | if(v[i]<v[i+1] | ^ | ; 12 | swap(v[i],v[i+1]); | ~~~~ sort10.cpp:11:20: warning: statement has no effect [-Wunused-value] 11 | if(v[i]<v[i+1] | ~~~~^~~~~~~ sort10.cpp:13:21: error: expected ‘)’ before ‘;’ token 13 | sem=0; | ^ | ) sort10.cpp:11:15: note: to match this ‘(’ 11 | if(v[i]<v[i+1] | ^ sort10.cpp:13:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 13 | sem=0; | ~~~^~ sort10.cpp:14:30: error: expected ‘;’ before ‘for’ 14 | }while(sem==0) | ^ | ; 15 | for(int i=0;i<=-n-1;i--) | ~~~ sort10.cpp:16:16: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 16 | if(v[i]%10==0) | ^~ sort10.cpp:17:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 17 | cout<<v[i]<<" "; | ^ sort10.cpp:17:32: error: expected ‘}’ at end of input sort10.cpp:3:11: note: to match this ‘{’ 3 | int main(){ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sort10 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ă.