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
272443 Nguyễn Thanh Bảo Ngân HUTECH IT OFFICE TOUR C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 691 2023-11-21 10:59:24

Lỗi biên dịch:

Main.cc: In function ‘void check(int, int, int, int)’:
Main.cc:16:9: error: invalid types ‘int[int]’ for array subscript
   if(a[i] == 1){
         ^
Main.cc:25:8: error: ‘i’ was not declared in this scope
   if(a[i] == 0){
        ^
Main.cc: In function ‘int main()’:
Main.cc:39:18: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
     check(a,n,x,y);
                  ^
Main.cc:13:6: note:   initializing argument 1 of ‘void check(int, int, int, int)’
 void check (int a, int n, int x, int y){
      ^~~~~
Main.cc: In function ‘void nhapmang(int*, int)’:
Main.cc:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &a[i]);
         ~~~~~^~~~~~~~~~~~~
Main.cc: In function ‘int main()’:
Main.cc:37:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d", &n, &x, &y);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~