#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(void)
{
int num = 0;
srand((unsigned)time(NULL));
int i = rand();
while (scanf("%d", &num) != EOF)
{
if (num == i)
{
printf("恭喜你,猜对了。\n");
break;
}
else
{
printf("不对哦,继续猜。\n");
}
}
printf("游戏结束。");
return 0;
}
评论区