#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
int main(void)
{
int value, num;
srand((unsigned int)time(NULL));
num = rand() % 100;
while (1)
{
scanf("%d", &value);
if (num > value)
{
printf("你输入的数太小了!再试试看\n");
}
else if (num < value)
{
printf("你输入的数太大了!再试试看\n");
}
else
{
printf("恭喜猜对了!");
break;
}
}
return 0;
}
标签:num,数字,int,value,else,小游戏,printf,include From: https://blog.51cto.com/u_16073189/6213959