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
268920 Nguyễn Thị Ngọc Phượng Số PI C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 267 2023-11-18 20:46:22

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,14159
            ^
Main.cc:7:9: note: in expansion of macro ‘Pi’
     int Pi ;
         ^~
Main.cc:8:18: error: ‘n’ was not declared in this scope
     scanf("%d", &n);
                  ^
Main.cc:8:18: note: suggested alternative: ‘yn’
     scanf("%d", &n);
                  ^
                  yn
Main.cc:9:47: error: binary expression in operand of fold-expression
     leibniz ( Pi = 4*(1-1/3 + 1/5 - 1/7 + 1/9 - 1/11+...))
                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Main.cc:9:47: error: operand of fold expression has no unexpanded parameter packs
Main.cc:9:5: error: ‘leibniz’ was not declared in this scope
     leibniz ( Pi = 4*(1-1/3 + 1/5 - 1/7 + 1/9 - 1/11+...))
     ^~~~~~~