#100
Se dă un șir cu n elemente numere naturale. Să se determine câte elemente din şir sunt numere prime.
| Problema | NrApPrime | Operații I/O |
nrapprime.in/nrapprime.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64853672 | Utilizator | |
| Fișier | nrapprime.cpp | Dimensiune | 508 B |
| Data încărcării | 07 Iunie 2026, 13:54 | Scor/rezultat | Eroare de compilare |
nrapprime.cpp:1:1: error: ‘include’ does not name a type 1 | include <fstream> | ^~~~~~~ In file included from /usr/include/c++/13/cmath:45, from nrapprime.cpp:2: /usr/include/c++/13/ext/type_traits.h:164:35: error: ‘constexpr const bool __gnu_cxx::__is_null_pointer’ redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/13/ext/type_traits.h:159:5: note: previous declaration ‘template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)’ 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/13/ext/type_traits.h:164:26: error: ‘nullptr_t’ is not a member of ‘std’ 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ nrapprime.cpp: In function ‘int main()’: nrapprime.cpp:17:5: error: ‘ifstream’ was not declared in this scope 17 | ifstream fin("nrapprime.in"); | ^~~~~~~~ nrapprime.cpp:3:1: note: ‘std::ifstream’ is defined in header ‘<fstream>’; did you forget to ‘#include <fstream>’? 2 | #include <cmath> +++ |+#include <fstream> 3 | using namespace std; nrapprime.cpp:18:5: error: ‘ofstream’ was not declared in this scope 18 | ofstream fout("nrapprime.out"); | ^~~~~~~~ nrapprime.cpp:18:5: note: ‘std::ofstream’ is defined in header ‘<fstream>’; did you forget to ‘#include <fstream>’? nrapprime.cpp:21:5: error: ‘fin’ was not declared in this scope; did you mean ‘sin’? 21 | fin >> n; | ^~~ | sin nrapprime.cpp:29:5: error: ‘fout’ was not declared in this scope 29 | fout << cnt; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrApPrime 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ă.