#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const int maxn = 1005;
int main() {
char list[4][65];
char Date[7][10] = {"MON","TUE","WED","THU","FRI","SAT","SUN"};
int date = 0,hour = 0,min = 0;
bool isfirst = true,isfind = false,ischeck = false;
for(int i = 0;i < 4;i++)
cin >> list[i];
for(int i = 0;i < 60;i++){
if(!isfirst && !ischeck){
if(list[0][i] == list[1][i]){
if(('0' <= list[0][i]) && (list[0][i] <= '9')) {
hour = list[0][i] - '0';
ischeck = true;
}
else if(('A' <= list[0][i]) && (list[0][i] <= 'N')){
hour = list[0][i] - 'A' + 10;
ischeck = true;
}
}
}
if((list[0][i] == list[1][i]) && isfirst) {
if (('A' <= list[0][i]) && (list[0][i] <= 'G')) {
date = list[0][i] - 'A';
isfirst = false;
}
}
if((list[2][i] == list[3][i]) && !isfind) {
if((('A' <= list[2][i]) && (list[2][i] <= 'Z')) || (('a' <= list[2][i]) && (list[2][i] <= 'z'))){
min = i;
isfind = true;
}
}
}
printf("%s %02d:%02d",Date[date],hour,min);
return 0;
}
【PAT B 1014】福尔摩斯的约会
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 传送门 https://pintia.cn/problem-sets/994805260223102976/pro...
- 题目 链接:PAT (Basic Level) Practice 1014 福尔摩斯的约会 大侦探福尔摩斯接到一张...
- 题目 大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkgg...
- 题目信息 大侦探福尔摩斯接到一张奇怪的字条:“我们约会吧! 3485djDkxh4hhGE 2984akDfkkk...