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
269625 Lê Huỳnh Ngọc Chuỗi lớn nhất C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 764 2023-11-18 21:45:23

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:9:17: error: ‘n’ was not declared in this scope
     char a[N],b[n];
                 ^
Main.cc:10:20: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[N]’ [-Wformat=]
     scanf("\n%s",&a);
                  ~~^
Main.cc:11:12: error: ‘b’ was not declared in this scope
     strcpy(b,a)
            ^
Main.cc:12:17: error: ‘i’ was not declared in this scope
     for(int i=0;i<=N;i++)
                 ^
Main.cc:7:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     int N,dem=0,thu=0;scanf("%d\n",&N);
                       ~~~~~^~~~~~~~~~~
Main.cc:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("\n%s",&a);
     ~~~~~^~~~~~~~~~~