猜数字游戏
来源:互联网 发布:汽车修理学习软件 编辑:程序博客网 时间:2024/06/14 09:16
//// main.cpp// activity//// Created by 徐伟 on 6/13/16.// Copyright © 2016 fizz. All rights reserved.//#include <iostream>#include<ctime>#include<cstdlib>using namespace std;int main(int argc,const char *argv[]){ int n,num,count=1; srand(time(0)); //time(0)返回值作种子 num=rand()%1000; do { cout<<"猜一个数:"; cin>>n; if(n==num) break; else if(n>num) cout<<"大了!"<<endl; else cout<<"小了!"<<endl; count++; }while(true); cout<<"历经"<<count<<"次,猜对了。"<<endl; return 0;}
0 0
- 游戏_猜数字
- 猜数字游戏
- 猜数字游戏
- 猜数字游戏源码
- 猜数字游戏
- 猜数字游戏
- python猜数字游戏
- 猜数字游戏
- 猜数字游戏
- 猜数字游戏
- 猜数字游戏
- 猜数字游戏
- 猜数字游戏
- 关于猜数字游戏
- 猜数字游戏实现
- 猜数字游戏
- 模拟猜数字游戏
- 猜数字游戏
- Android NumberPicker探析
- hdu 5444 继续二叉查找树
- mysql删除数据
- ANR in an IntentService with its own process
- Android ViewPager的适配器PagerAdapter的一般写法
- 猜数字游戏
- spark 1.6.1安装
- 20150427堆排序、网页、字符串简介
- windows下QT各版本简介
- AJAX
- rtmp
- 浅谈final、finally、finalize的区别
- select value from v$diag_info where name='Default Trace File';
- 小学生算数能力系统