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
99526 LUFFI GHÉP ĐOẠN MÃ C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 570 2023-05-26 15:44:44

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:24:9: warning: init-statement in selection statements only available with -std=c++1z or -std=gnu++1z
     if (a[0]>(a[n-1]+a[n-2])
         ^
Main.cc:25:9: error: expected ‘;’ before ‘printf’
         printf("CO");
         ^~~~~~
Main.cc:24:13: warning: statement has no effect [-Wunused-value]
     if (a[0]>(a[n-1]+a[n-2])
         ~~~~^~~~~~~~~~~~~~~~
Main.cc:26:5: error: expected primary-expression before ‘else’
     else 
     ^~~~
Main.cc:26:5: error: expected ‘)’ before ‘else’
Main.cc:19:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
Main.cc:22:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a[i]);
   ~~~~~^~~~~~~~~~~~