#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 | #64918326 | Utilizator | |
| Fișier | ordonat_neordonat.cpp | Dimensiune | 830 B |
| Data încărcării | 13 Iunie 2026, 10:37 | Scor/rezultat | Eroare de compilare |
ordonat_neordonat.cpp: In function ‘int main()’: ordonat_neordonat.cpp:4:2: error: expected primary-expression before ‘,’ token 4 | {, | ^ ordonat_neordonat.cpp:5:4: error: expected primary-expression before ‘int’ 5 | int v[1000] , i, n, consta=1, strdesc=1, strcresc=1, cresc=1, desc=1; | ^~~ ordonat_neordonat.cpp:7:11: error: ‘n’ was not declared in this scope 7 | cin >> n; | ^ ordonat_neordonat.cpp:9:8: error: ‘i’ was not declared in this scope 9 | for(i=0; i<n; i++) | ^ ordonat_neordonat.cpp:10:12: error: ‘v’ was not declared in this scope 10 | cin >> v[i] ; | ^ ordonat_neordonat.cpp:12:8: error: ‘i’ was not declared in this scope 12 | for(i=0; i<n-1; i++){ | ^ ordonat_neordonat.cpp:14:8: error: ‘v’ was not declared in this scope 14 | if(v[i]!=v[i+1]) | ^ ordonat_neordonat.cpp:15:5: error: ‘consta’ was not declared in this scope; did you mean ‘const’? 15 | consta=0; | ^~~~~~ | const ordonat_neordonat.cpp:17:8: error: ‘v’ was not declared in this scope 17 | if(v[i]>=v[i+1]) | ^ ordonat_neordonat.cpp:18:5: error: ‘strcresc’ was not declared in this scope 18 | strcresc=0; | ^~~~~~~~ ordonat_neordonat.cpp:20:8: error: ‘v’ was not declared in this scope 20 | if(v[i]<=v[i+1]) | ^ ordonat_neordonat.cpp:21:5: error: ‘strdesc’ was not declared in this scope 21 | strdesc=0; | ^~~~~~~ ordonat_neordonat.cpp:23:8: error: ‘v’ was not declared in this scope 23 | if(v[i]>v[i+1]) | ^ ordonat_neordonat.cpp:24:5: error: ‘cresc’ was not declared in this scope 24 | cresc=0; | ^~~~~ ordonat_neordonat.cpp:26:8: error: ‘v’ was not declared in this scope 26 | if(v[i]<v[i+1]) | ^ ordonat_neordonat.cpp:27:5: error: ‘desc’ was not declared in this scope 27 | desc=0; | ^~~~ ordonat_neordonat.cpp:30:8: error: ‘consta’ was not declared in this scope; did you mean ‘const’? 30 | if(consta==1) | ^~~~~~ | const ordonat_neordonat.cpp:33:13: error: ‘strdesc’ was not declared in this scope 33 | else if(strdesc==1) | ^~~~~~~ ordonat_neordonat.cpp:36:13: error: ‘strcresc’ was not declared in this scope 36 | else if(strcresc==1) | ^~~~~~~~ ordonat_neordonat.cpp:39:13: error: ‘desc’ was not declared in this scope 39 | else if(desc==1) | ^~~~ ordonat_neordonat.cpp:42:13: error: ‘cresc’ was not declared in this scope 42 | else if(cresc==1) | ^~~~~
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ă.