#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
char week[7][5]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
int ans=0;
char str1[70],str2[70],str3[70],str4[70];
gets(str1);
gets(str2);
gets(str3);
gets(str4);
int i;
int len1=strlen(str1),len2=strlen(str2),len3=strlen(str3),len4=strlen(str4);
for(i=0;i<len1&&i<len2;i++){
if(str1[i]==str2[i] &&str1[i]<='G'&&str1[i]>='A'){
printf("%s ",week[str1[i]-'A']);
break;
}
}
for(int k=i+1;k<len1&&k<len2;k++){
if(str1[k]==str2[k]){
if(str1[k]<='9'&&str1[k]>='0'){
printf("%02d:",str1[k]-'0');
break;
}
else if(str1[k]<='N' && str1[k]>='A'){ printf("%02d:",str1[k]-'A'+10);break; }
}
}
for(int i=0;i<len3&&i<len4;i++){
if(str3[i]==str4[i]){
if(str3[i]<='Z'&&str3[i]>='A'||str3[i]>='a'&&str3[i]<='z'){
printf("%02d",i);
break;
}
}
}
return 0;
}
【PAT】1061. Dating
最新推荐文章于 2020-08-19 09:36:57 发布