#187
CifFrecv
Să se scrie un program care citeşte cel mult 1.000.000
de numere naturale din intervalul închis [0,9]
şi determină cel mai mare număr prim citit şi numărul său de apariţii.
Variante Bacalaureat 2009
Problema | CifFrecv | Operații I/O |
ciffrecv.in /ciffrecv.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
Id soluție | #50159762 | Utilizator | |
Fișier | ciffrecv.cpp | Dimensiune | 374 B |
Data încărcării | 29 Martie 2024, 09:01 | Scor / rezultat | Eroare de compilare |
ciffrecv.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("ciffrecv.out") ^ ciffrecv.cpp: In function 'int main()': ciffrecv.cpp:8:16: error: 'c' was not declared in this scope { while(fin>>c) v[c]++; ^ ciffrecv.cpp:8:19: error: 'v' was not declared in this scope { while(fin>>c) v[c]++; ^ ciffrecv.cpp:9:4: error: 'v' was not declared in this scope if(v[7]>0) {fout<<7<<" "<<v[7]; return 0;} ^ ciffrecv.cpp:9:13: error: 'fout' was not declared in this scope if(v[7]>0) {fout<<7<<" "<<v[7]; return 0;} ^ ciffrecv.cpp:10:4: error: 'v' was not declared in this scope if(v[5]>0) {fout<<5<<" "<<v[5]; return 0;} ^ ciffrecv.cpp:10:13: error: 'fout' was not declared in this scope if(v[5]>0) {fout<<5<<" "<<v[5]; return 0;} ^ ciffrecv.cpp:11:4: error: 'v' was not declared in this scope if(v[3]>0) {fout<<3<<" "<<v[3]; return 0;} ^ ciffrecv.cpp:11:13: error: 'fout' was not declared in this scope if(v[3]>0) {fout<<3<<" "<<v[3]; return 0;} ^ ciffrecv.cpp:12:4: error: 'v' was not declared in this scope if(v[2]>0) {fout<<2<<" "<<v[2]; return 0;} ^ ciffrecv.cpp:12:13: error: 'fout' was not declared in this scope if(v[2]>0) {fout<<2<<" "<<v[2]; return 0;} ^ ciffrecv.cpp:13:1: error: 'fout' was not declared in this scope fout<<"nu exista"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifFrecv 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ă.