完成猜数字游戏
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int d5p1()
{
srand((unsigned int)time(NULL));
int s = rand() % 100 + 1;
int tmp = 0;
while (tmp != s)
{
scanf("%d", &tmp);
if (tmp < s)
{
printf("猜小了!\n");
}
if (tmp > s)
{
printf("猜大了!\n");
}
}
printf("猜对了!\n");
system("pause");
return 0;
}