#111
NrFact
Să se scrie un program care citește un șir de n
numere naturale şi determină numărul din şir care are număr maxim de factori primi.
Problema | NrFact | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53013949 | Utilizator | |
Fișier | nrfact.cpp | Dimensiune | 636 B |
Data încărcării | 15 Octombrie 2024, 16:14 | Scor / rezultat | Eroare de compilare |
nrfact.cpp:3:15: warning: character constant too long for its type [enabled by default] ifstream fin('sort.in') ^ nrfact.cpp:4:16: warning: character constant too long for its type [enabled by default] ofstream fout('sort.out') ^ nrfact.cpp:3:2: error: 'ifstream' does not name a type ifstream fin('sort.in') ^ nrfact.cpp: In function 'int main()': nrfact.cpp:20:3: error: 'cin' was not declared in this scope cin>>n; ^ nrfact.cpp:20:3: note: suggested alternative: In file included from nrfact.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ nrfact.cpp:27:23: error: 'swap' was not declared in this scope swap(v[i],v[j]); ^ nrfact.cpp:27:23: note: suggested alternatives: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrfact.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: 'std::swap' swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/ios:39, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrfact.cpp:1: /usr/include/c++/4.8/bits/exception_ptr.h:160:5: note: 'std::__exception_ptr::swap' swap(exception_ptr& __lhs, exception_ptr& __rhs) ^ nrfact.cpp:31:23: error: 'swap' was not declared in this scope swap(v[i],v[j]); ^ nrfact.cpp:31:23: note: suggested alternatives: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrfact.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: 'std::swap' swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/ios:39, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrfact.cpp:1: /usr/include/c++/4.8/bits/exception_ptr.h:160:5: note: 'std::__exception_ptr::swap' swap(exception_ptr& __lhs, exception_ptr& __rhs) ^ nrfact.cpp:33:9: error: 'cout' was not declared in this scope cout<<v[i]<<' '; ^ nrfact.cpp:33:9: note: suggested alternative: In file included from nrfact.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrFact 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ă.