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
466416 Anh - Vũ CHUỖI KÍ TỰ MỞ VÀ ĐÓNG C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 727 2024-05-24 15:29:32

Lỗi biên dịch:

Main.cc: In function ‘int doixung1(char*)’:
Main.cc:8:28: error: ‘n’ was not declared in this scope
    8 |         for(int i = 0; i < n / 2; i++){
      |                            ^
Main.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   21 | int main(){
      |         ^~
Main.cc:21:9: note: remove parentheses to default-initialize a variable
   21 | int main(){
      |         ^~
      |         --
Main.cc:21:9: note: or replace parentheses with braces to value-initialize a variable
Main.cc:21:11: error: a function-definition is not allowed here before ‘{’ token
   21 | int main(){
      |           ^
Main.cc:32:2: error: expected ‘}’ at end of input
   32 | }
      |  ^
Main.cc:5:23: note: to match this ‘{’
    5 | int doixung1(char c[]){
      |                       ^
Main.cc:32:2: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      |  ^