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
465098 TPITB CHUỖI KÍ TỰ MỞ VÀ ĐÓNG C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 860 2024-05-24 13:40:04

Lỗi biên dịch:

Main.cc: In function ‘int kiemtra2(char*)’:
Main.cc:21:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   21 |         for(int i=0;i<=(strlen(kitu)-1)/2;i++)
      |                     ~^~~~~~~~~~~~~~~~~~~~
Main.cc:24:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   24 |         for(int i=strlen(kitu)-1;i>(strlen(kitu)-1)/2;i--)
      |                                  ~^~~~~~~~~~~~~~~~~~~
Main.cc:25:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   25 |                 if(kitu[i] =='}'||kitu[i] ==']'||kitu[i] ==')')
      |                 ^~
Main.cc:27:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   27 |                         return 1;
      |                         ^~~~~~
Main.cc: In function ‘int main()’:
Main.cc:37:31: error: ‘kiemtra1’ was not declared in this scope; did you mean ‘kiemtra2’?
   37 |         if(kiemtra2(kitu)==1&&kiemtra1(kitu)==1)
      |                               ^~~~~~~~
      |                               kiemtra2
Main.cc: In function ‘void nhap(char*)’:
Main.cc:7:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         fgets(kitu,101,stdin);
      |         ~~~~~^~~~~~~~~~~~~~~~