#include <iostream> using namespace std; int main(int argc, char** argv) { int x=100,d=0; string a; cout<<"请想一个数"<<endl; system("pause"); cout<<"你猜的这个数是:"<<(x-d)/2+d<<endl; cin>>a; for(int i=0;i<8;i++){ if(a=="大了"){ x=(x-d)/2+d; cout<<"这个数是:"<<(x-d)/2+d<<endl; cin>>a; } if(a=="小了"){ d=(x-d)/2+d; cout<<"这个数是:"<<(x-d)/2+d<<endl; cin>>a; } if(a=="相等"){ cout<<"赢了!"; cin>>a; } } return 0; }
标签:std,return,数字,int,main,cout From: https://www.cnblogs.com/w6826301/p/17464226.html