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
99160 LUFFI LỰA CHỌN ĐỘI TUYỂN ICPC C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 680 2023-05-26 15:18:52

Lỗi biên dịch:

Main.cc: In function ‘int tong(int*, int, int)’:
Main.cc:17:9: warning: unused variable ‘s’ [-Wunused-variable]
     int s=0;
         ^
Main.cc:19:13: error: ‘s’ was not declared in this scope
             s+=a[i];
             ^
Main.cc:20:12: error: ‘s’ was not declared in this scope
     return s;
            ^
Main.cc: In function ‘int main()’:
Main.cc:25:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
Main.cc:26:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&k);
     ~~~~~^~~~~~~~~
Main.cc:29:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&a[i]);
             ~~~~~^~~~~~~~~~~~