답안 #1011739

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1011739 2024-07-01T07:54:47 Z uranhishig Hotter Colder (IOI10_hottercolder) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int Guess(int G);
 
//int run(int L, int R) {
//    if(L == R){
//    	return 1;
//	}
//}

int HC(int n){
	int x = 0, i;
	bool x = true;
   for(int i = 1; i <= 500; i++){
   		if(Guess(i) == -1){
   				break;
   				x = false;
		   }
   }
   if(x){
   		cout << "500" << endl;
   }
   else{
   	   cout << i << endl;
   }

}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:14:7: error: conflicting declaration 'bool x'
   14 |  bool x = true;
      |       ^
hottercolder.cpp:13:6: note: previous declaration as 'int x'
   13 |  int x = 0, i;
      |      ^
hottercolder.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^