-
Notifications
You must be signed in to change notification settings - Fork 1
/
1014. 福尔摩斯的约会 (20)
41 lines (41 loc) · 988 Bytes
/
1014. 福尔摩斯的约会 (20)
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
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
// FILE * fp = fopen("柯南的约会.txt","r");
char* kirby[7] = {"MON","TUE","WED","THU","FRI","SAT","SUN"};
char zqd[100] = {0},gr[100] = {0},zqy[100] = {0},zjl[100] = {0};
scanf("%s %s %s %s",zqd,gr,zqy,zjl);
// fscanf(fp,"%s %s %s %s",zqd,gr,zqy,zjl);
int flag = 1;
for (int i = 0;;i++){
if (zqd[i] == gr[i]){
if (flag){
if (zqd[i] < 'A'||zqd[i] > 'G'){
continue;
}else{
printf("%s ",kirby[zqd[i] - 'A']);
flag = 0;
continue;
}
}
if (((zqd[i] >= 'A'&&zqd[i] <= 'N')||(zqd[i] >= '0'&&zqd[i] <= '9'))){
if (zqd[i] >= '0'&&zqd[i] <= '9'){
printf("%02d:",zqd[i] - '0');
}else{
printf("%02d:",zqd[i] - 55);
}
break;
}
}
}
for (int i = 0;;i++){
if (zqy[i] == zjl[i]){
if ((zqy[i] >= 'a'&&zqy[i] <= 'z')||(zqy[i] >= 'A'&&zqy[i] <= 'Z')){
printf("%02d",i);
break;
}
}
}
return 0;
}