#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 | #64822553 | Utilizator | |
| Fișier | ciffrecv.cpp | Dimensiune | 435 B |
| Data încărcării | 03 Iunie 2026, 18:23 | Scor/rezultat | 100 puncte |
In file included from /usr/include/c++/13/iostream:41, from ciffrecv.cpp:1: In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at ciffrecv.cpp:21:10: /usr/include/c++/13/ostream:169:25: warning: ‘max’ may be used uninitialized [-Wmaybe-uninitialized] 169 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ ciffrecv.cpp: In function ‘int main()’: ciffrecv.cpp:10:33: note: ‘max’ was declared here 10 | long int i, fr[10]={0}, nr, max, k; | ^~~ In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘int main()’ at ciffrecv.cpp:21:20: /usr/include/c++/13/ostream:169:25: warning: ‘k’ may be used uninitialized [-Wmaybe-uninitialized] 169 | { return _M_insert(__n); } | ~~~~~~~~~^~~~~ ciffrecv.cpp: In function ‘int main()’: ciffrecv.cpp:10:38: note: ‘k’ was declared here 10 | long int i, fr[10]={0}, nr, max, k; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.002 secunde | OK. | 40 | 40 | ||
| 3 | 0.047 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
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ă.