#2299
media_geometrica
Se dau n
numere naturale. Calculați media lor geometrică.
Problema | media_geometrica | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53602343 | Utilizator | |
Fișier | media_geometrica.cpp | Dimensiune | 263 B |
Data încărcării | 06 Noiembrie 2024, 10:49 | Scor / rezultat | Eroare de compilare |
media_geometrica.cpp: In function 'int main()': media_geometrica.cpp:13:28: error: no matching function for call to 'pow(double&, int, double)' cout << pow (p, 1,0 / n); ^ media_geometrica.cpp:13:28: 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 media_geometrica.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, 3 provided In file included from media_geometrica.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: media_geometrica.cpp:13:28: note: candidate expects 2 arguments, 3 provided cout << pow (p, 1,0 / n); ^ In file included from media_geometrica.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, 3 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, 3 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema media_geometrica 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ă.