-
Notifications
You must be signed in to change notification settings - Fork 0
/
躲避箭头.c
112 lines (111 loc) · 3.37 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include<stdio.h>
#include<time.h>
void pause()
{ int b;
b=0;
while(b<8000000)
//延时
{
b++;
printf("");
}
}
void clear()
{ int c=0;
while(c<=30)
{ printf("\n");
c++;
}
}
int main()
{ int aw,points=0;
clock_t start,end;
printf("**********little game starts**********");
printf("\nenter the number where you can survive the arrows\n");
printf("\n请在看到箭头后迅速输入没有箭头的列数,立刻按’Enter’进行下一轮。时间和分数都合格者胜出\n\n");
getchar();
start= time(NULL);
printf("1 2 3 4 5 6 7 \n");
pause();
printf("↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==6) points++;
pause();
printf(" ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==1||aw==3||aw==6) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==5) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==4) points++;
pause();
printf(" ↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==1||aw==4||aw==7) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==6) points++;
pause();
printf(" ↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==1||aw==5) points++;
pause();
printf("↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==3||aw==4||aw==7) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==3||aw==5) points++;
pause();
printf("↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==2||aw==7||aw==5) points++;
pause();
printf(" ↓ ↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==1||aw==7) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==3) points++;
pause();
printf(" ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==1||aw==3||aw==4||aw==6) points++;
pause();
printf("↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==4||aw==5) points++;
pause();
printf("↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==2||aw==6||aw==7) points++;
pause();
printf(" ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==1||aw==4) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==2||aw==6) points++;
pause();
printf(" ↓ ↓ ↓ ↓ \n");
scanf("%d",&aw);
if(aw==1||aw==4||aw==7) points++;
pause();
printf("↓ ↓ ↓ ↓ ↓ ↓\n");
scanf("%d",&aw);
if(aw==3) points++;
end=time(NULL);
printf("You escape %d arrows",aw);
printf("You use %.1f seconds",difftime(end,start));
if(points>15 && difftime(end,start)<28)printf("congratulations!!\n\nYou win");
else printf("You fail the little game\n\nTry again if you want");
return 0;
}