#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 | #41011663 | Utilizator | |
Fișier | logaritm.cpp | Dimensiune | 468 B |
Data încărcării | 09 Ianuarie 2023, 16:07 | Scor / rezultat | Eroare de compilare |
logaritm.cpp: In function 'double lone(double, double)': logaritm.cpp:5:22: error: expected ')' before ';' token #define euler 2.71828; ^ logaritm.cpp:9:12: note: in expansion of macro 'euler' if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:5:22: error: expected ')' before ';' token #define euler 2.71828; ^ logaritm.cpp:9:12: note: in expansion of macro 'euler' if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:17: error: expected primary-expression before ',' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:20: error: expected ';' before ')' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:35: error: expected ';' before '(' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:29: warning: statement has no effect [-Wunused-value] if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:41: error: expected primary-expression before ',' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:44: error: expected ';' before ')' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:52: error: expected primary-expression before ')' token if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp:9:52: error: expected ';' before ')' token logaritm.cpp:11:6: error: 'else' without a previous 'if' }else{ ^ logaritm.cpp:5:22: error: expected ')' before ';' token #define euler 2.71828; ^ logaritm.cpp:12:16: note: in expansion of macro 'euler' if(pow(euler,mj)>n+eps){ ^ logaritm.cpp:5:22: error: expected ')' before ';' token #define euler 2.71828; ^ logaritm.cpp:12:16: note: in expansion of macro 'euler' if(pow(euler,mj)>n+eps){ ^ logaritm.cpp:12:21: error: expected primary-expression before ',' token if(pow(euler,mj)>n+eps){ ^ logaritm.cpp:12:24: error: expected ';' before ')' token if(pow(euler,mj)>n+eps){ ^ logaritm.cpp:12:31: error: expected primary-expression before ')' token if(pow(euler,mj)>n+eps){ ^ logaritm.cpp:12:31: error: expected ';' before ')' token logaritm.cpp:14:10: error: 'else' without a previous 'if' }else return lone(mj,ls); ^ logaritm.cpp:9:32: error: label 'pow' used but not defined if(pow(euler,mj)<=n+eps && pow(euler,mj)>=n-eps){ ^ logaritm.cpp: In function 'int main()': logaritm.cpp:22:5: error: expected ';' before 'cout' cout<<lone(1,n); ^
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ă.