#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 | #54167650 | Utilizator | |
Fișier | media_geometrica.cpp | Dimensiune | 228 B |
Data încărcării | 21 Noiembrie 2024, 10:22 | Scor / rezultat | Eroare de compilare |
media_geometrica.cpp: In function 'int main()': media_geometrica.cpp:9:14: error: 'x' was not declared in this scope cin>>x; ^ media_geometrica.cpp:11:20: error: no matching function for call to 'sqrt(int&, int&)' mg=sqrt(i,P); ^ media_geometrica.cpp:11:20: 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:156:1: note: double sqrt(double) __MATHCALL (sqrt,, (_Mdouble_ __x)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:156:1: note: candidate expects 1 argument, 2 provided In file included from media_geometrica.cpp:2:0: /usr/include/c++/4.8/cmath:494:5: note: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) sqrt(_Tp __x) ^ /usr/include/c++/4.8/cmath:494:5: note: template argument deduction/substitution failed: media_geometrica.cpp:11:20: note: candidate expects 1 argument, 2 provided mg=sqrt(i,P); ^ In file included from media_geometrica.cpp:2:0: /usr/include/c++/4.8/cmath:486:3: note: constexpr long double std::sqrt(long double) sqrt(long double __x) ^ /usr/include/c++/4.8/cmath:486:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/4.8/cmath:482:3: note: constexpr float std::sqrt(float) sqrt(float __x) ^ /usr/include/c++/4.8/cmath:482:3: note: candidate expects 1 argument, 2 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ă.