#include <iostream> #include <cmath> using namespace std; int main(int argc, char** argv) { string a; int max=100,min=0; while(a!="对了"){ cout<<"猜是"<<(max-min)/2+min<<endl; cin>>a; if(a=="大了"){ max = (max-min)/2+min; }else{ min = (max-min)/2+min; } } return 0; }
标签:数字,min,AI,max,int,include From: https://www.cnblogs.com/wangyueshuo/p/17464228.html