#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#define N 100
int main(void) {
char days[7][7] = { "MON", "TUE","WED","THU","FRI","SAT","SUN" };
char str1[N], str2[N], str3[N], str4[N];
scanf("%s %s %s %s", str1, str2, str3, str4);
char first, sec;
int i, third;
for (i = 0; i < strlen(str1) && i < strlen(str2); i++) {
if (str1[i] == str2[i] && str1[i] >= 'A' && str1[i] <= 'G') {
first = str1[i];
break;
}
}
for (i++; i < strlen(str1) && i < strlen(str2); i++) {
if (str1[i] == str2[i] && ((str1[i] >= 'A' && str1[i] <= 'N') || isdigit(str1[i]))) {
sec = str1[i];
break;
}
}
for (i = 0; i < strlen(str3) && i < strlen(str4); i++) {
if (str3[i] == str4[i] && isalpha(str4[i])) {
third = i;
break;
}
}
printf("%s %02d:%02d\n", days[first - 'A'], sec >= '0' && sec <= '9' ? sec - '0' : sec - 'A' + 10, third);
return 0;
}
1061. Dating (20)解题报告
最新推荐文章于 2018-04-23 17:37:05 发布