-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path猜数字游戏.c
52 lines (51 loc) · 2.04 KB
/
猜数字游戏.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <unistd.h>
int main()
{
int m=250;
int n=0;
int i=0;
printf("欢迎来到猜数字游戏\n");
while (i<1)
{
printf("输入数字:");
scanf("%d",&n);
if(m>n && n<200)
{
printf("这个数字太小了\n");
}
if(m>n && n>=200 && n<250 )
{
printf("这个数字小了,但很近了\n");
}
if(m<n && n>300)
{
printf("这个数字太大了\n");
}
if(m<n && n<=300 && n>250)
{
printf("这个数字大了,但很近了\n");
}
if(m==n)
{
printf("Yes\n");
i++;
}
}
printf(" ############# # # # ######### \n");usleep(700000);
printf(" # # # # # # # # \n");usleep(700000);
printf(" # # # # # # # # \n");usleep(700000);
printf(" # ####### # # # # # # ######### \n");usleep(700000);
printf(" # # ########### # # # # # \n");usleep(700000);
printf(" # # # # # # # # # \n");usleep(700000);
printf(" ############# # # # # # ######### \n");usleep(700000);
printf("\n");
printf(" ############ # # ######### ######### \n");usleep(700000);
printf(" # # # # # # # \n");usleep(700000);
printf(" # # # # # # # \n");usleep(700000);
printf(" # # # # ######### ######### \n");usleep(700000);
printf(" # # # # # # # \n");usleep(700000);
printf(" # # # # # # # \n");usleep(700000);
printf(" ############ # ######### # # \n");usleep(700000);
return 0;
}