#1681
Power
C++
Prietenul nostru, Zolly, a învățat la scoală despre ridicarea la putere. Ajutați-l să calculeze \( a^b\).
Problema | Power | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55040639 | Utilizator | |
Fișier | power.cpp | Dimensiune | 303 B |
Data încărcării | 17 Decembrie 2024, 22:18 | Scor / rezultat | Eroare de compilare |
power.cpp:6:21: error: too many decimal points in number if(0 <= P&&P <= 2.000.000.000&&a + b > 0){double P=pow(a,b); ^ power.cpp: In function 'int main()': power.cpp:5:5: error: 'cin' was not declared in this scope cin>>a>>b; ^ power.cpp:5:5: note: suggested alternative: In file included from power.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ power.cpp:6:13: error: 'P' was not declared in this scope if(0 <= P&&P <= 2.000.000.000&&a + b > 0){double P=pow(a,b); ^ power.cpp:6:54: error: redeclaration of 'double P' if(0 <= P&&P <= 2.000.000.000&&a + b > 0){double P=pow(a,b); ^ power.cpp:6:13: error: '<typeprefixerror>P' previously declared here if(0 <= P&&P <= 2.000.000.000&&a + b > 0){double P=pow(a,b); ^ power.cpp:7:47: error: 'cout' was not declared in this scope cout<<P<<endl; ^ power.cpp:7:47: note: suggested alternative: In file included from power.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ power.cpp:7:56: error: 'endl' was not declared in this scope cout<<P<<endl; ^ power.cpp:7:56: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from power.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ power.cpp:9:10: error: 'cout' was not declared in this scope else{cout<<"EROARE"<<endl;} ^ power.cpp:9:10: note: suggested alternative: In file included from power.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ power.cpp:9:26: error: 'endl' was not declared in this scope else{cout<<"EROARE"<<endl;} ^ power.cpp:9:26: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from power.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 Power 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ă.