/ OPS /

记录详情

Compile Error

/in/foo.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main
      |     ^~~~
/in/foo.cc:6:2: error: expected '}' before 'return'
    6 |  return 0;
      |  ^~~~~~
/in/foo.cc:4:1: note: to match this '{'
    4 | {
      | ^
/in/foo.cc:5:7: error: invalid user-defined conversion from 'std::basic_ostream<char>' to 'int' [-fpermissive]
    5 |  cout << "Welcome to the OPS."
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/ios:44,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/9/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>
  117 |       explicit operator bool() const
      |                ^~~~~~~~
/usr/include/c++/9/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:6:2: error: expected ',' or ';' before 'return'
    6 |  return 0;
      |  ^~~~~~
/in/foo.cc:7:1: error: expected declaration before '}' token
    7 | }
      | ^

信息

递交者
类型
递交
语言
C++
递交时间
2023-09-23 13:32:46
评测时间
2023-09-23 13:32:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes