Mã chấm: 268490
Main.cc: In function ‘int main()’:
Main.cc:6:18: error: invalid operands of types ‘const char [4]’ and ‘double’ to binary ‘operator&’
scanft("%lf" &c);
~~~~~~^~
Main.cc:6:5: error: ‘scanft’ was not declared in this scope
scanft("%lf" &c);
^~~~~~
Main.cc:6:5: note: suggested alternative: ‘scanf’
scanft("%lf" &c);
^~~~~~
scanf
Main.cc:10:15: error: ‘n’ was not declared in this scope
while (0<=n<=5000) {
^
Main.cc:11:57: error: expected ‘;’ before ‘+’ token
res+= 1 - (1/3) + (1/5) -(1/7) + (1/9) - (1/11) +... ;
^
Main.cc:14:5: error: expected ‘,’ or ‘;’ before ‘printf’
printf("PI = %0.8lf", PI);
^~~~~~
Main.cc:7:9: warning: unused variable ‘k’ [-Wunused-variable]
int k=0;
^
Main.cc:9:9: warning: unused variable ‘signal’ [-Wunused-variable]
int signal=-1;
^~~~~~
Main.cc:13:12: warning: unused variable ‘PI’ [-Wunused-variable]
double PI = 4 * res
^~