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
272297 Nguyễn Trọng Kiên HUTECH IT OFFICE TOUR C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 2193 2023-11-21 10:43:25

Lỗi biên dịch:

Main.cc:69:27: error: stray ‘#’ in program
   if (dem1 > dem2 && dem1 #include 
                           ^
Main.cc: In function ‘int sosanh(int, int)’:
Main.cc:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
Main.cc: In function ‘int main()’:
Main.cc:69:7: warning: init-statement in selection statements only available with -std=c++1z or -std=gnu++1z
   if (dem1 > dem2 && dem1 #include 
       ^~~~
Main.cc:69:28: error: expected ‘;’ before ‘include’
   if (dem1 > dem2 && dem1 #include 
                            ^~~~~~~
Main.cc:69:19: warning: statement has no effect [-Wunused-value]
   if (dem1 > dem2 && dem1 #include 
       ~~~~~~~~~~~~^~~~~~~
Main.cc:71:59: warning: declaration of ‘int nam(int*, int, int, int&, int&)’ has ‘extern’ and is initialized
 int nam(int arr[] , int n , int nam ,int &dem1 , int &dem3) 
                                                           ^
Main.cc:73:9: error: expected ‘}’ before ‘;’ token
  dem1 =0;
         ^
Main.cc:73:9: error: function ‘int nam(int*, int, int, int&, int&)’ is initialized like a variable
Main.cc:73:9: error: expected ‘)’ before ‘;’ token
Main.cc:73:9: warning: the address of ‘int nam(int*, int, int, int&, int&)’ will never be NULL [-Waddress]
Main.cc:80:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (dem1 == nam )
               ^~~
Main.cc:82:4: error: ‘dem3’ was not declared in this scope
    dem3 = dem1;
    ^~~~
Main.cc:82:4: note: suggested alternative: ‘dem2’
    dem3 = dem1;
    ^~~~
    dem2
Main.cc: In function ‘int sosanh(int, int)’:
Main.cc:108:5: error: redefinition of ‘int sosanh(int, int)’
 int sosanh(int dem1 , int dem2)
     ^~~~~~
Main.cc:38:5: note: ‘int sosanh(int, int)’ previously defined here
 int sosanh(int dem1 , int dem2)
     ^~~~~~
Main.cc:116:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
Main.cc: In function ‘int main()’:
Main.cc:117:5: error: redefinition of ‘int main()’
 int main()
     ^~~~
Main.cc:47:5: note: ‘int main()’ previously defined here
 int main()
     ^~~~
Main.cc:133:31: error: too many arguments to function ‘int nam(int*, int, int, int&)’
  nam(arr , n , x , dem1 , dem3);
                               ^
Main.cc:3:5: note: declared here
 int nam(int arr[] , int n , int nam ,int &dem1 ) 
     ^~~
Main.cc: At global scope:
Main.cc:149:2: error: ‘x’ does not name a type
 }x &&dem2 >=y)
  ^
Main.cc:152:3: error: expected unqualified-id before ‘else’
  }else if (dem1 <= dem2 && dem1 >=x &&dem2 >=y)
   ^~~~
Main.cc:156:1: error: expected declaration before ‘}’ token
 }
 ^
Main.cc: In function ‘int nam(int*, int, int, int&)’:
Main.cc:18:2: warning: control reaches end of non-void function [-Wreturn-type]
 }}
  ^
Main.cc: In function ‘int nu(int*, int, int, int&)’:
Main.cc:36:2: warning: control reaches end of non-void function [-Wreturn-type]
 }}
  ^
Main.cc: In function ‘int nu(int*, int, int, int&, int&)’:
Main.cc:106:2: warning: control reaches end of non-void function [-Wreturn-type]
 }}
  ^