/*
*Corpyright (c)2013,烟台大学计算机学院
*All right reseved.
*作者:z张梦佳
*完成日期:2013年11月18日
*版本号:v1.0
*输入描述:
*问题描述:随机数,猜大小
*程序输出:
*问题分析:
*算法设计:
*/
#include <iostream>
#include <ctime>
#include<cstdlib>
using namespace std;
int main(void)
{
int i,num2,s;
srand (time(0));
num2=rand()%1000;
for (i=0;10;i++)
{
cin>>s;
if (s > num2)
{
cout<<"你输大了,再小一点!"<<endl;
}
else if (s < num2)
{
cout<<"你输小了,再大一点!"<<endl;
}
else
{
cout<<"恭喜你,猜对了!"<<endl;
break;
}
}
}
另一个随机数
最新推荐文章于 2021-12-21 17:51:50 发布
