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
268760 Nguyễn Phạm Thành Hiếu Số PI C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 197 2023-11-18 20:35:00

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:7:28: error: found ‘:’ in nested-name-specifier, expected ‘::’
  for(unsigned int i=1; i<=n:i++)
                            ^
Main.cc:7:27: error: ‘n’ is not a class, namespace, or enumeration
  for(unsigned int i=1; i<=n:i++)
                           ^
Main.cc:7:32: error: expected ‘;’ before ‘)’ token
  for(unsigned int i=1; i<=n:i++)
                                ^
Main.cc:9:8: error: ‘pow’ was not declared in this scope
   res+=pow((-1), i)/(2*i+1);
        ^~~
Main.cc:9:8: note: suggested alternative: ‘putw’
   res+=pow((-1), i)/(2*i+1);
        ^~~
        putw
Main.cc:11:20: error: ‘rs’ was not declared in this scope
  printf("%0.5f", 4*rs);
                    ^~
Main.cc:11:20: note: suggested alternative: ‘res’
  printf("%0.5f", 4*rs);
                    ^~
                    res
Main.cc:6:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~