#作业3.1猜随机数
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include<iostream> using namespace std; int main() { int i=24, a=1, h=1; cout<<"Input a number between 0 and 100 "<<endl; do { cin>>a; if(a>i) cout<<"太大,请重新输入"<<endl; else if(a<i) cout<<"太小,请重新输入"<<endl; else cout<<"恭喜你猜对了,这个数是"<<a<<endl; h++; }while(h<10); return 0; }
最后
以上就是聪明音响最近收集整理的关于c++猜随机数的全部内容,更多相关c++猜随机数内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复