Mã chấm Tài khoản Bài tập Ngôn ngữ lập trình Trạng thái Thời gian Bộ nhớ Kích thước Thời gian nộp
268740 Trần Phương Thảo Số PI C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 455 2023-11-18 20:32:36

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:13:19: error: expected ‘;’ before ‘<=’ token
     for(int k=0, k<=n, k++);
                   ^~
Main.cc:13:19: error: expected primary-expression before ‘<=’ token
Main.cc:13:27: error: expected ‘;’ before ‘)’ token
     for(int k=0, k<=n, k++);
                           ^
Main.cc:13:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(int k=0, k<=n, k++);
     ^~~
Main.cc:14:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     {
     ^
Main.cc:15:23: error: ‘k’ was not declared in this scope
         sum+= sign/(2*k+1);
                       ^
Main.cc:19:33: error: ‘setprecision’ is not a member of ‘std’
     std::cout<