#4558
Cifre_IX
Se citește de la tastatură un număr natural cu cel mult nouă cifre. Să se determine dacă numărul citit are cifrele în ordine strict crescătoare, în ordine strict descrescătoare sau dacă are toate cifrele egale.
Problema | Cifre_IX | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50450898 | Utilizator | |
Fișier | cifre_ix.cpp | Dimensiune | 986 B |
Data încărcării | 10 Aprilie 2024, 09:23 | Scor / rezultat | Eroare de compilare |
cifre_ix.cpp:3:20: error: 'n' has not been declared int cresc(int comp,n,c,int ok=1){ ^ cifre_ix.cpp:3:22: error: 'c' has not been declared int cresc(int comp,n,c,int ok=1){ ^ cifre_ix.cpp: In function 'int cresc(int, int, int, int)': cifre_ix.cpp:5:11: error: 'n' was not declared in this scope while(n=!0 && ok!=1) ^ cifre_ix.cpp:7:5: error: 'c' was not declared in this scope c=n%10; ^ cifre_ix.cpp:12:5: error: 'else' without a previous 'if' else ok=0 ^ cifre_ix.cpp:13:5: error: expected ';' before '}' token } ^ cifre_ix.cpp: At global scope: cifre_ix.cpp:19:19: error: 'n' has not been declared int desc(int comp,n,c, int ok=1){ ^ cifre_ix.cpp:19:21: error: 'c' has not been declared int desc(int comp,n,c, int ok=1){ ^ cifre_ix.cpp: In function 'int desc(int, int, int, int)': cifre_ix.cpp:21:11: error: 'n' was not declared in this scope while(n=!0 && ok!=1) ^ cifre_ix.cpp:23:5: error: 'c' was not declared in this scope c=n%10; ^ cifre_ix.cpp:28:5: error: 'else' without a previous 'if' else ok=0 ^ cifre_ix.cpp:29:5: error: expected ';' before '}' token } ^ cifre_ix.cpp: At global scope: cifre_ix.cpp:35:16: error: 'c' has not been declared int egal(int n,c,comp, int ok=1) ^ cifre_ix.cpp:35:18: error: 'comp' has not been declared int egal(int n,c,comp, int ok=1) ^ cifre_ix.cpp: In function 'int egal(int, int, int, int)': cifre_ix.cpp:37:21: error: lvalue required as left operand of assignment while(n!=0 && ok=1) ^ cifre_ix.cpp:39:5: error: 'comp' was not declared in this scope comp=n%10; ^ cifre_ix.cpp:40:5: error: 'c' was not declared in this scope c=n%10; ^ cifre_ix.cpp: In function 'int main()': cifre_ix.cpp:54:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(cresc==1) ^ cifre_ix.cpp:55:8: error: 'cout' was not declared in this scope cout<<"strict crescator"; ^ cifre_ix.cpp:57:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(desc==1) ^ cifre_ix.cpp:58:9: error: 'cout' was not declared in this scope cout<<"strict descrescator"; ^ cifre_ix.cpp:60:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(egal==1) ^ cifre_ix.cpp:61:9: error: 'cout' was not declared in this scope cout<<"egale"; ^ cifre_ix.cpp:63:9: error: 'cout' was not declared in this scope cout<<"neordonate"; ^ cifre_ix.cpp:64:9: error: 'retun' was not declared in this scope retun 0; ^ cifre_ix.cpp:64:15: error: expected ';' before numeric constant retun 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cifre_IX 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ă.