#1960
Se dă un șir de n numere naturale nenule. Pentru fiecare element din șir se va afișa valoarea 1 dacă acesta este perfect sau 0 în caz contrar.
| Problema | Perfecte | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
| Id soluție | #63714124 | Utilizator | |
| Fișier | perfecte.cpp | Dimensiune | 843 B |
| Data încărcării | 16 Martie 2026, 13:11 | Scor/rezultat | Eroare de compilare |
perfecte.cpp:2:1: error: 'include' does not name a type include namespace std; ^ perfecte.cpp: In function 'int main()': perfecte.cpp:7:11: error: 'cin' was not declared in this scope if (!(cin >> n)) return 1; ^ perfecte.cpp:7:11: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ perfecte.cpp:11:9: error: 'cin' was not declared in this scope cin >> num; ^ perfecte.cpp:11:9: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ perfecte.cpp:14:13: error: 'cout' was not declared in this scope cout << 0 << (i == n - 1 ? "" : " "); ^ perfecte.cpp:14:13: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ perfecte.cpp:29:13: error: 'cout' was not declared in this scope cout << 1 << (i == n - 1 ? "" : " "); ^ perfecte.cpp:29:13: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ perfecte.cpp:31:13: error: 'cout' was not declared in this scope cout << 0 << (i == n - 1 ? "" : " "); ^ perfecte.cpp:31:13: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ perfecte.cpp:35:5: error: 'cout' was not declared in this scope cout << endl; ^ perfecte.cpp:35:5: note: suggested alternative: In file included from perfecte.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ perfecte.cpp:35:13: error: 'endl' was not declared in this scope cout << endl; ^ perfecte.cpp:35:13: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from perfecte.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Perfecte 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ă.