#include<iostream>
#include<string>
#include<map>
using namespace std;
//在星期时不是所有的大写字母都满足题意
//map<char,string> week;
int main()
{
/*
week['A']="MON";
week['B']="TUE";
week['C']="WED";
week['D']="THU";
week['E']="FRI";
week['F']="SAT";
week['G']="SUN";
*/
string week[7]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
string s1,s2,s3,s4;
cin>>s1>>s2>>s3>>s4;
int size=min(s1.size(),s2.size());
int flag=1;
for(int i=0;i<size;i++)
{
if(s1[i]==s2[i]&& s1[i]>='A'&&s1[i]<='G'&&flag==1)
{
cout<<week[s1[i]-'A']<<" ";
flag=0;
continue;
}
if(flag==0&&s1[i]==s2[i])
{
if(s1[i]>='0'&&s1[i]<='9')
{
cout<<"0"<<s1[i]<<":";
break;
}
if(s1[i]>='A'&&s1[i]<='N')
{
cout<<s1[i]-'A'+10<<":";
break;
}
}
}
size=min(s3.size(),s4.size());
for(int i=0;i<size;i++)
{
if(s3[i]==s4[i]&&isalpha(s3[i]))
{
if(i<=9)cout<<"0"<<i;
else
cout<<i;
break;
}
}
return 0;
}
pat 乙 1014. 福尔摩斯的约会
最新推荐文章于 2023-12-14 15:10:23 发布