希望大家能采用。(*_*)
第一次发布,真的不容易!
啥也不说了,上代码!
#includeusing namespace std; int main() { char j; srand(time(0)); cout<<"Game name: guess numbers"< >y; if(y=='A') l=1,m=100,x=rand()%100+1,k=25;//设置最大值,最小值,次数上限 else if(y=='B') l=1,m=1000,x=rand()%1000+1,k=50; else if(y=='C') l=1,m=10000,x=rand()%10000+1,k=100; else if(y=='D') { cout<<"Please enter the minimum and maximum values!"< =0) { if(a[r]>='0'&&a[r]<='9') a1+=(a[r]-'0')*r1;//将字符型变成整型 else { cout<<"Input error, the game is over!"< =0) { if(b[o]>='0'&&b[o]<='9') b1+=(b[o]-'0')*o1; else { cout<<"Input error, the game is over!"< =b1||b1<=a1||b1>=10000)//判断是否超出范围 { cout<<"Input error, the game is over!"< =m);//循环刷出合适的数 if(m>=100) k=100; else k=10; cout<<"OK!Setup complete!"< 1) cout<<" again!"< 1) cout<<"Tip: you have guessed "< >n; if(n>x)//偏小 { cout<<"You guessed wrong!"< k) cout<<"You guessed too many times! Come on next time!"< >j; if(j=='1') cout<<"OK, let's have another round!"<



