#187
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 | #64688599 | Utilizator | |
| Fișier | ciffrecv.cpp | Dimensiune | 352 B |
| Data încărcării | 23 Mai 2026, 11:08 | Scor/rezultat | 0 puncte |
ciffrecv.cpp: In function ‘int main()’: ciffrecv.cpp:8:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 8 | while(fin>>x) | ^~~~~ ciffrecv.cpp:11:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 11 | for (i=0;i<=9;i++) | ^~~ ciffrecv.cpp:13:19: warning: array subscript 10 is above array bounds of ‘int [10]’ [-Warray-bounds=] 13 | {MAX=i; NR_AP=v[i];} | ~~~^ ciffrecv.cpp:7:20: note: while referencing ‘v’ 7 | {int x,i,MAX,NR_AP,v[10]={0}; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.049 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
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ă.