#247
Se dau mai multe numere naturale, fiecare cu cel mult 9 cifre. Să se afişeze, în ordine descrescătoare, toate cifrele care apar în numerele date.
Variante Bacalaureat 2009
| Problema | CifreOrd1 | Operații I/O |
cifreord1.in/cifreord1.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64287356 | Utilizator | |
| Fișier | cifreord1.cpp | Dimensiune | 603 B |
| Data încărcării | 28 Aprilie 2026, 09:41 | Scor/rezultat | Eroare de compilare |
cifreord1.cpp:4:32: error: expected ‘)’ before ‘ofstream’ 4 | ifstream fin("cifreord1.in" | ~ ^ | ) 5 | ofstream fout ("cifreord1.out"); | ~~~~~~~~ cifreord1.cpp: In function ‘int main()’: cifreord1.cpp:9:9: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 9 | while(fin>>n) | ^~~~~ cifreord1.cpp:11:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 11 | while(n!=0;) | ^~~~~ cifreord1.cpp:11:23: error: expected ‘)’ before ‘;’ token 11 | while(n!=0;) | ~ ^ | ) cifreord1.cpp:11:13: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 11 | while(n!=0;) | ^~~~~ cifreord1.cpp:11:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 11 | while(n!=0;) | ^ cifreord1.cpp:11:24: error: expected primary-expression before ‘)’ token cifreord1.cpp:23:18: error: ‘fout’ was not declared in this scope 23 | fout<<i<<" ";a++; | ^~~~ cifreord1.cpp:8:27: warning: unused variable ‘b’ [-Wunused-variable] 8 | long fr[10]={0},n,b,c,i; | ^ cifreord1.cpp:8:29: warning: unused variable ‘c’ [-Wunused-variable] 8 | long fr[10]={0},n,b,c,i; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifreOrd1 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ă.