제출 #1353079

#제출 시각아이디문제언어결과실행 시간메모리
1353079zabaChess Rush (CEOI20_chessrush)C++20
컴파일 에러
0 ms0 KiB
#include "arithmetics.h"
#include <iostream>

using namespace std;

int main {
  cout << "1" << endl;
}

컴파일 시 표준 에러 (stderr) 메시지

chessrush.cpp:6:5: error: cannot declare '::main' to be a global variable
    6 | int main {
      |     ^~~~
chessrush.cpp:7:22: error: expected '}' before ';' token
    7 |   cout << "1" << endl;
      |                      ^
chessrush.cpp:6:10: note: to match this '{'
    6 | int main {
      |          ^
chessrush.cpp:7:15: error: invalid user-defined conversion from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' [-fpermissive]
    7 |   cout << "1" << endl;
      |   ~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/13/ios:46,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from chessrush.cpp:2:
/usr/include/c++/13/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++/13/bits/basic_ios.h:117:16: note:   return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
chessrush.cpp:8:1: error: expected declaration before '}' token
    8 | }
      | ^