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

Lỗi biên dịch:

Main.cc: In function ‘bool isValid(std::string)’:
Main.cc:12:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   12 |         for(int i = 0; i < s.size(); i++){
      |                        ~~^~~~~~~~~~
Main.cc:23:14: error: ‘else’ without a previous ‘if’
   23 |             }else{
      |              ^~~~
Main.cc:24:27: error: ‘i’ was not declared in this scope
   24 |                 st.push(s[i]);
      |                           ^
Main.cc: At global scope:
Main.cc:27:5: error: expected unqualified-id before ‘return’
   27 |     return st.empty();
      |     ^~~~~~
Main.cc:28:5: error: expected declaration before ‘}’ token
   28 |     }
      |     ^
Main.cc: In function ‘bool isValid(std::string)’:
Main.cc:26:9: warning: control reaches end of non-void function [-Wreturn-type]
   26 |         }
      |         ^