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
98612 Killnet GHÉP ĐOẠN MÃ C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 508 2023-05-26 14:37:45

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:18:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
        if(a[k] = a[i]+a[j])
           ~~~~~^~~~~~~~~~~
Main.cc:18:8: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
        if(a[k] = a[i]+a[j])
        ^~
Main.cc:20:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
         break;
         ^~~~~
Main.cc:26:1: error: expected ‘}’ at end of input
 }
 ^
Main.cc:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
Main.cc:11:11: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
      scanf("%d", &a[i]);
      ~~~~~^~~~~~~~~~~~~