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
269345 Trần Tấn Đạt Chuỗi lớn nhất C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 1126 2023-11-18 21:22:20

Lỗi biên dịch:

Main.cc: In function ‘int point(char*, char, char)’:
Main.cc:16:25: error: ‘n’ was not declared in this scope
     for (int i = 0; i < n; i++)
                         ^
Main.cc: In function ‘int main()’:
Main.cc:36:14: error: expected primary-expression before ‘)’ token
     getchar(());
              ^
Main.cc:37:19: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[100]’ [-Wformat=]
     scanf("%s", &a);
                 ~~^
Main.cc:41:14: warning: unused variable ‘temp’ [-Wunused-variable]
     {   char temp = a[0];
              ^~~~
Main.cc:35:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
Main.cc:37:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", &a);
     ~~~~~^~~~~~~~~~