#3973
Logaritm
C++
Dându-se un număr real x
, să se scrie un program care calculează \(ln(x)\) cu 6
zecimale exacte.
Subiecte Atestat Informatica - Vâlcea
Problema | Logaritm | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
Id soluție | #54824855 | Utilizator | |
Fișier | logaritm.cpp | Dimensiune | 543 B |
Data încărcării | 09 Decembrie 2024, 18:32 | Scor / rezultat | Eroare de compilare |
logaritm.cpp: In function 'double ln(double)': logaritm.cpp:9:23: error: call of overloaded 'abs(double)' is ambiguous while(abs(putere/n)>2000000000) ^ logaritm.cpp:9:23: note: candidates are: In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from logaritm.cpp:1: /usr/include/stdlib.h:775:12: note: int abs(int) extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; ^ In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from logaritm.cpp:1: /usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Logaritm 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ă.