제출 #1267020

#제출 시각아이디문제언어결과실행 시간메모리
1267020ti24dung_ntCluedo (IOI10_cluedo)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

void Solve()
{
    int murd = 1, loca = 1, weap = 1;
    while(true)
    {
        cout << "Theory(" << murd << ", " << loca << ", " << weap << ")" << endl;
        cout.flush();

        int type;
        cin >> type;
        if(type == 0) return 0;
        else if(type == 1) ++murd;
        else if(type == 2) ++loca;
        else ++weap;
    }

}

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

cluedo.cpp: In function 'void Solve()':
cluedo.cpp:14:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
   14 |         if(type == 0) return 0;
      |                              ^