标签:include screen ffffff c语言 公开赛
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main()
{
int random = 0;
int input = 0;
int start = 1;
while (start)
{
printf("*********************\n");
printf("**1 start 0.exit**\n");
printf("*********************\n");
printf("请选择:>");
scanf("%d", &start);
switch (start)
{
case 1:
{
srand((unsigned)time(NULL));
random = rand()%100;
while (1)
{
printf("请输入你猜的数:>");
scanf("%d", &input);
if (input > random)
{
printf("猜大了\n");
}
else if (input < random)
{
printf("猜的太小了\n");
}
else
{
printf("你好厉害啊\n");
break;
}
}
break;
}
case 0:
{
printf("感谢使用猜数字游戏,bye bye\n");
exit(0);
break;
}
default:
{
break;
}
}
return 0;
}
标签:include screen ffffff c语言 公开赛
原文地址:http://10706198.blog.51cto.com/10696198/1697250