-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path32.c
65 lines (64 loc) · 1017 Bytes
/
32.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
//输入一个字母判断是星期几,如首字符相同,判断第二个字母
#include<stdio.h>
#include<Windows.h>
#include<conio.h>
int main()
{
char ch;
printf("请输入第一个字母:\n");
while ((ch = _getche()) != 0)
{
printf("\n");
switch (ch)
{
case 'M':
case 'm':
printf("Monday\n");
break;
case 'T':
case 't':
printf("请输入第二个子母:\n");
if ((ch == _getche()) == 'u' || ch == 'U')
{
printf("\nTuesday\n");
}
else if (ch == 'h' || ch == 'H')
{
printf("\nThursday\n");
}
else
{
printf("输入错误!");
}
break;
case 'W':
case 'w':
printf("Wednesday\n");
break;
case 'F':
case 'f':
printf("Friday\n");
break;
case 'S':
case 's':
printf("请输入第二个字母\n");
if ((ch = _getche()) == 'a' || ch == 'A')
{
printf("\nSaturday\n");
}
else if (ch == 'U' || ch == 'u')
{
printf("\nSunday\n");
}
else
{
printf("输入错误!\n");
}
break;
default:
break;
}
}
system("pause");
return 0;
}