Compile Error

/in/foo.cc:3:5: error: cannot declare '::main' to be a global variable
 int main{
     ^~~~
/in/foo.cc:4:30: error: expected '}' before ';' token
     cout<<"Hello World"<<endl;
                              ^
/in/foo.cc:4:24: error: invalid user-defined conversion from 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' to 'int' [-fpermissive]
     cout<<"Hello World"<<endl;
     ~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/6/ios:44:0,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/basic_ios.h:117:16: note: candidate is: std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits<char>] <near match>
       explicit operator bool() const
                ^~~~~~~~
/usr/include/c++/6/bits/basic_ios.h:117:16: note:   return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
/in/foo.cc:5:5: error: expected unqualified-id before 'return'
     return 0;
     ^~~~~~
/in/foo.cc:6:1: error: expected declaration before '}' token
 }
 ^

信息

递交者
类型
递交
题目
P1000 输出“Hello World!"
语言
C++
递交时间
2021-09-28 20:23:11
评测时间
2021-09-28 20:23:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes