#2695
Cub Perfect
Se citește un număr n
și apoi n
numere naturale. Să se verifice pentru fiecare număr dacă este cub perfect.
Problema | Cub Perfect | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #23392121 | Utilizator | |
Fișier | cub_perfect.cpp | Dimensiune | 462 B |
Data încărcării | 30 Iunie 2020, 16:46 | Scor / rezultat | Eroare de compilare |
cub_perfect.cpp: In function 'int abs(int)': cub_perfect.cpp:21:14: error: declaration of 'int abs(int)' has a different exception specifier int abs(int x){ ^ cub_perfect.cpp:7:5: error: from previous declaration 'int abs(int) throw ()' int abs(int x); ^ cub_perfect.cpp: In function 'int cub(float)': cub_perfect.cpp:28:17: error: call of overloaded 'abs(float&)' is ambiguous if( pow(abs(x),1/a)==floor( pow(abs(x),1/a) ) ) return 1; ^ cub_perfect.cpp:28:17: note: candidates are: cub_perfect.cpp:21:5: note: int abs(int) int abs(int x){ ^ In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, 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 cub_perfect.cpp:1: /usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^ cub_perfect.cpp:28:41: error: call of overloaded 'abs(float&)' is ambiguous if( pow(abs(x),1/a)==floor( pow(abs(x),1/a) ) ) return 1; ^ cub_perfect.cpp:28:41: note: candidates are: cub_perfect.cpp:21:5: note: int abs(int) int abs(int x){ ^ In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, 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 cub_perfect.cpp:1: /usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^ cub_perfect.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cub Perfect 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ă.