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
269825 Võ Anh Kiệt Số PI C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 329 2023-11-18 21:59:18

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:5:12: error: expected unqualified-id before numeric constant
 #define pi 3.14
            ^
Main.cc:11:10: note: in expansion of macro ‘pi’
   double pi = 4.0;
          ^~
Main.cc:13:22: error: lvalue required as left operand of assignment
     pi+=(-1)^i/(2*i+1);}
                      ^
Main.cc:14:28: error: lvalue required as left operand of assignment
   pi = round(pi * 100000)/ 100000;
                            ^~~~~~
Main.cc:8:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&n);
   ~~~~~^~~~~~~~~