#2600
expatr
Scrieți un program care citește de la tastatură un număr natural a
și care afișează partea întreagă a valorii expresiei \( {{3 \cdot \left(a^2+a^4 \right)} \over {a^2+a^4 + \sqrt {a^2+a^4} }} + \sqrt {a^2+a^4} \).
Problema | expatr | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54884214 | Utilizator | |
Fișier | expatr.cpp | Dimensiune | 278 B |
Data încărcării | 11 Decembrie 2024, 11:02 | Scor / rezultat | Eroare de compilare |
expatr.cpp: In function 'int main()': expatr.cpp:11:24: error: no matching function for call to 'pow(int&)' double suma = pow(a) + pow(a); ^ expatr.cpp:11:24: note: candidates are: In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from expatr.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: double pow(double, double) __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: candidate expects 2 arguments, 1 provided In file included from expatr.cpp:2:0: /usr/include/c++/4.8/cmath:434:5: note: template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up) pow(_Tp __x, _Up __y) ^ /usr/include/c++/4.8/cmath:434:5: note: template argument deduction/substitution failed: expatr.cpp:11:24: note: candidate expects 2 arguments, 1 provided double suma = pow(a) + pow(a); ^ In file included from expatr.cpp:2:0: /usr/include/c++/4.8/cmath:411:3: note: constexpr long double std::pow(long double, long double) pow(long double __x, long double __y) ^ /usr/include/c++/4.8/cmath:411:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/cmath:407:3: note: constexpr float std::pow(float, float) pow(float __x, float __y) ^ /usr/include/c++/4.8/cmath:407:3: note: candidate expects 2 arguments, 1 provided expatr.cpp:11:33: error: no matching function for call to 'pow(int&)' double suma = pow(a) + pow(a); ^ expatr.cpp:11:33: note: candidates are: In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from expatr.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: double pow(double, double) __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: candidate expects 2 arguments, 1 provided In file included from expatr.cpp:2:0: /usr/include/c++/4.8/cmath:434:5: note: template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up) pow(_Tp __x, _Up __y) ^ /usr/include/c++/4.8/cmath:434:5: note: template argument deduction/substitution failed: expatr.cpp:11:33: note: candidate expects 2 arguments, 1 provided double suma = pow(a) + pow(a); ^ In file included from expatr.cpp:2:0: /usr/include/c++/4.8/cmath:411:3: note: constexpr long double std::pow(long double, long double) pow(long double __x, long double __y) ^ /usr/include/c++/4.8/cmath:411:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/cmath:407:3: note: constexpr float std::pow(float, float) pow(float __x, float __y) ^ /usr/include/c++/4.8/cmath:407:3: note: candidate expects 2 arguments, 1 provided expatr.cpp:15:12: error: expected primary-expression before 'int' cout <<int>>(rezultat) << endl; ^ expatr.cpp:15:12: error: expected ';' before 'int' expatr.cpp:12:12: warning: unused variable 'rezultat' [-Wunused-variable] double rezultat = suma / (suma + sqrt(suma) + cbrt(suma)); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema expatr 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ă.