Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
72049 伍思语 01第一个C++程序 C++ Compile Error 0 MS 0 KB 90 2024-04-30 18:13:16

Tests(0/0):


Code:

#include<iostream> using namespace std; int main{ cout<<"hello,lema"; return 0; }


Run Info:

Main.cc:4:19: error: expected '}' before ';' token
 cout<<"hello,lema";    
                   ^
Main.cc:4:5: error: invalid user-defined conversion from 'std::basic_ostream' to 'int' [-fpermissive]
 cout<<"hello,lema";    
     ^
In file included from /usr/include/c++/5/ios:44:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_ios.h:117:16: note: candidate is: std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits] 
       explicit operator bool() const
                ^
/usr/include/c++/5/bits/basic_ios.h:117:16: note:   return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
Main.cc:5:1: error: expected unqualified-id before 'return'
 return 0;
 ^
Main.cc:6:1: error: expected declaration before '}' token
 }
 ^