#1320
Să se verifice dacă in șir este: șir constant, șir strict crescător, șir crescător, șir strict descrescător, șir descrescător, șir neordonat.
| Problema | ordonat_neordonat | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64918264 | Utilizator | |
| Fișier | ordonat_neordonat.cpp | Dimensiune | 811 B |
| Data încărcării | 13 Iunie 2026, 10:26 | Scor/rezultat | Eroare de compilare |
ordonat_neordonat.cpp: In function ‘int main()’: ordonat_neordonat.cpp:5:22: error: expected unqualified-id before ‘const’ 5 | int v[1000] , i,n,const=0, strdesc=0, strcresc=0, cresc=0, desc=0; | ^~~~~ ordonat_neordonat.cpp:9:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(i=0; i<n; i++) | ^~~ ordonat_neordonat.cpp:11:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | for(i=1; i<n; i++){ | ^~~ ordonat_neordonat.cpp:14:5: error: ‘consta’ was not declared in this scope; did you mean ‘const’? 14 | consta=0; | ^~~~~~ | const ordonat_neordonat.cpp:16:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 16 | if(v[i] = v[i+1]) | ~~~~~^~~~~~~~ ordonat_neordonat.cpp:17:5: error: ‘strdesc’ was not declared in this scope 17 | strdesc=0; | ^~~~~~~ ordonat_neordonat.cpp:18:5: error: ‘strcresc’ was not declared in this scope 18 | strcresc=0; | ^~~~~~~~ ordonat_neordonat.cpp:21:5: error: ‘cresc’ was not declared in this scope 21 | cresc=1; | ^~~~~ ordonat_neordonat.cpp:24:5: error: ‘desc’ was not declared in this scope 24 | desc=1; | ^~~~ ordonat_neordonat.cpp:26:8: error: ‘consta’ was not declared in this scope; did you mean ‘const’? 26 | if(consta==1) | ^~~~~~ | const ordonat_neordonat.cpp:29:13: error: ‘strdesc’ was not declared in this scope 29 | else if(strdesc==1) | ^~~~~~~ ordonat_neordonat.cpp:32:13: error: ‘strcresc’ was not declared in this scope 32 | else if(strcresc==1) | ^~~~~~~~ ordonat_neordonat.cpp:35:13: error: ‘cresc’ was not declared in this scope 35 | else if(cresc==0) | ^~~~~ ordonat_neordonat.cpp:38:13: error: ‘desc’ was not declared in this scope 38 | else if(desc==0) | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ordonat_neordonat 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ă.