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
19921 Nguyễn Trường Giang Chọn cạnh tam giác C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 225 2023-02-25 19:47:43

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:8:18: error: expected ‘;’ before ‘<=’ token
     for(int i=0,i<=n;i++)
                  ^~
Main.cc:8:18: error: expected primary-expression before ‘<=’ token
Main.cc:11:26: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
         scanf("%d",arr[n]);
                    ~~~~~~^
Main.cc:6:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
Main.cc:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",arr[n]);
         ~~~~~^~~~~~~~~~~~~