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
272005 Vũ Văn Trung HUTECH IT OFFICE TOUR C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 487 2023-11-21 10:14:38

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:11:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      strlen(s)==n;
      ~~~~~~~~~^~~
Main.cc:11:15: warning: statement has no effect [-Wunused-value]
Main.cc:13:23: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[100]’ [-Wformat=]
         scanf("%s", &s);
                     ~~^
Main.cc:15:16: error: ‘t’ was not declared in this scope
     int strlen(t) =1;
                ^
Main.cc:16:17: error: redeclaration of ‘int strlen’
     int strlen(z) =0;
                 ^
Main.cc:15:9: note: ‘int strlen’ previously declared here
     int strlen(t) =1;
         ^~~~~~
Main.cc:16:16: error: ‘z’ was not declared in this scope
     int strlen(z) =0;
                ^
Main.cc:18:21: error: ‘strlen’ cannot be used as a function
         if (strlen(t) ==x && strlen (z)== y) {
                     ^
Main.cc:18:39: error: ‘strlen’ cannot be used as a function
         if (strlen(t) ==x && strlen (z)== y) {
                                       ^
Main.cc:19:26: error: ‘strlen’ cannot be used as a function
             dem+=strlen(s);
                          ^
Main.cc:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d", &n, &x, &y);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cc:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s", &s);
         ~~~~~^~~~~~~~~~