#include <iostream>
using namespace std;
int main(){
int l,r;
l=1;
r=1000000000;
int m=(l+r)/2;
int ans=1;
while(ans!=0&&l<=r){
std::cout<<m<<endl;
std::cin>>ans;
if(ans==-1){
l=m+1;
}
if(ans==1){
r=m-1;
}
if(ans==0)return 0;
m=(l+r)/2;
}
return 0;
}
返回信息:
Wrong Answer. wrong output format Unexpected end of file - int32 expected
然后全wa了