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
269585 Cao Nguyễn Thanh Tú Chuỗi lớn nhất C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 850 2023-11-18 21:41:19

Lỗi biên dịch:

Main.cc: In function ‘int tinhtoan(char*, int)’:
Main.cc:14:27: warning: for increment expression has no effect [-Wunused-value]
     for(int i = 0; i < n;-1; i++){
                           ^
Main.cc:14:28: error: expected ‘)’ before ‘;’ token
     for(int i = 0; i < n;-1; i++){
                            ^
Main.cc:14:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(int i = 0; i < n;-1; i++){
     ^~~
Main.cc:14:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     for(int i = 0; i < n;-1; i++){
                              ^
Main.cc:14:30: error: ‘i’ was not declared in this scope
Main.cc:22:28: error: expected ‘;’ before ‘i’
     for(int i = 0; i < n-1 i++){
                            ^
Main.cc: In function ‘void nhap(char*, int)’:
Main.cc:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%c",&a[i]);
         ~~~~~^~~~~~~~~~~~
Main.cc: In function ‘int main()’:
Main.cc:35:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~