#178
patratPerfect
Să se scrie un program care verifică dacă un număr natural citit de la tastatură este pătrat perfect.
Problema | patratPerfect | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54990321 | Utilizator | |
Fișier | patratperfect.cpp | Dimensiune | 163 B |
Data încărcării | 15 Decembrie 2024, 13:36 | Scor / rezultat | Eroare de compilare |
patratperfect.cpp: In function 'int main()': patratperfect.cpp:4:3: error: 'cin' was not declared in this scope { cin>>n; ^ patratperfect.cpp:4:3: note: suggested alternative: In file included from patratperfect.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ patratperfect.cpp:5:14: error: 'sqrt' was not declared in this scope if(sqrt(n)==sqrt(n)) ^ patratperfect.cpp:6:5: error: 'cout' was not declared in this scope cout << "da" << endl; ^ patratperfect.cpp:6:5: note: suggested alternative: In file included from patratperfect.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ patratperfect.cpp:6:21: error: 'endl' was not declared in this scope cout << "da" << endl; ^ patratperfect.cpp:6:21: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from patratperfect.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ patratperfect.cpp:8:5: error: 'cout' was not declared in this scope cout << "nu" << endl; ; ^ patratperfect.cpp:8:5: note: suggested alternative: In file included from patratperfect.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ patratperfect.cpp:8:21: error: 'endl' was not declared in this scope cout << "nu" << endl; ; ^ patratperfect.cpp:8:21: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from patratperfect.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 patratPerfect 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ă.