猜数字代码
来源:互联网 发布:预决算软件有哪些 编辑:程序博客网 时间:2024/05/29 12:28
#include <iostream>
include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(0));
int theNumber=rand()%100+1;
int tries=0,guess;
cout<<"欢迎来猜数字"<<endl<<endl;
do
{
cout<<"enter a number between 1~100"<<endl;
cin>>guess;
++tries;
if(guess>theNumber)
cout<<"too high"<<endl;
if(guess<theNumber)
cout<<"too low"<<endl;
}while(guess!=theNumber);
cout<<"the number of your try "<<tries<<endl;
return 0;
}
- 猜数字代码
- java猜数字代码
- 猜数字游戏代码
- c代码:猜数字游戏
- Java简单猜数字代码
- 一个猜数字游戏代码的改进
- 猜数字java代码【本人菜鸟】
- [原创]猜数字游戏 的java代码
- java代码实现猜数字游戏
- java语言的猜数字游戏代码
- 数字时钟(代码)
- 判断数字字母代码
- java数字代码
- datalist数字分页代码
- 爱情数字代码大全
- 数字加千位符JS代码
- 数码管数字变化代码
- 数字格式化代码
- 杨辉三角C++代码
- 15周项目三:带姓名的成绩单
- IOS之同步请求、异步请求、GET请求、POST请求
- 通过非本机访问MySQL报 ERROR 2003 和 ERROR 1130 问题解决方法
- DB2数据库编目的概念以及对其的正确解析
- 猜数字代码
- db2上新建表空间和数据库
- 如何在 Ubuntu 上安装和使用 DropBox
- 双机冷备一不小心出了问题
- OGRE的良好架构
- .Net设计模式之适配器模式(Adapter Pattern)
- I/O编程-File类和RandomAccessFile类
- FPGA学习之路
- Android开发notification跳转