#3458
sin_cos
Se dă un număr natural x
, reprezentând mărimea în grade sexagesimale a unui unghi. Să se afișeze sin(x)
și cos(x)
.
Problema | sin_cos | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #44152665 | Utilizator | |
Fișier | sin_cos.cpp | Dimensiune | 224 B |
Data încărcării | 02 Iulie 2023, 20:56 | Scor / rezultat | Eroare de compilare |
sin_cos.cpp: In function 'int main()': sin_cos.cpp:8:53: error: no matching function for call to 'sin(double, int)' cout<<fixed<<setprecision(3)<<sin(x * 3,14 / 180) << ' ' << cos(x * 3,14 / 180); ^ sin_cos.cpp:8:53: 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 sin_cos.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:65:1: note: double sin(double) __MATHCALL (sin,, (_Mdouble_ __x)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:65:1: note: candidate expects 1 argument, 2 provided In file included from sin_cos.cpp:2:0: /usr/include/c++/4.8/cmath:456:5: note: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sin(_Tp) sin(_Tp __x) ^ /usr/include/c++/4.8/cmath:456:5: note: template argument deduction/substitution failed: sin_cos.cpp:8:53: note: candidate expects 1 argument, 2 provided cout<<fixed<<setprecision(3)<<sin(x * 3,14 / 180) << ' ' << cos(x * 3,14 / 180); ^ In file included from sin_cos.cpp:2:0: /usr/include/c++/4.8/cmath:448:3: note: constexpr long double std::sin(long double) sin(long double __x) ^ /usr/include/c++/4.8/cmath:448:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/4.8/cmath:444:3: note: constexpr float std::sin(float) sin(float __x) ^ /usr/include/c++/4.8/cmath:444:3: note: candidate expects 1 argument, 2 provided sin_cos.cpp:8:83: error: no matching function for call to 'cos(double, int)' cout<<fixed<<setprecision(3)<<sin(x * 3,14 / 180) << ' ' << cos(x * 3,14 / 180); ^ sin_cos.cpp:8:83: 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 sin_cos.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:63:1: note: double cos(double) __MATHCALL (cos,, (_Mdouble_ __x)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:63:1: note: candidate expects 1 argument, 2 provided In file included from sin_cos.cpp:2:0: /usr/include/c++/4.8/cmath:215:5: note: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::cos(_Tp) cos(_Tp __x) ^ /usr/include/c++/4.8/cmath:215:5: note: template argument deduction/substitution failed: sin_cos.cpp:8:83: note: candidate expects 1 argument, 2 provided cout<<fixed<<setprecision(3)<<sin(x * 3,14 / 180) << ' ' << cos(x * 3,14 / 180); ^ In file included from sin_cos.cpp:2:0: /usr/include/c++/4.8/cmath:207:3: note: constexpr long double std::cos(long double) cos(long double __x) ^ /usr/include/c++/4.8/cmath:207:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/4.8/cmath:203:3: note: constexpr float std::cos(float) cos(float __x) ^ /usr/include/c++/4.8/cmath:203:3: note: candidate expects 1 argument, 2 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sin_cos 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ă.