AcWing 1547. 约会
原题链接
简单
作者:
leo123456
,
2020-09-01 16:40:14
,
所有人可见
,
阅读 440
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
string a,b,c,d;
cin>>a>>b>>c>>d;
int k=0;
while(true){
if(a[k]==b[k]&&a[k]>='A'&&a[k]<='G') break;
k++;
}
char weekdays[7][4]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
printf("%s ",weekdays[a[k]-'A']);
k++;
while(true){
if(a[k]==b[k]&&(a[k]>='0'&&a[k]<='9'||a[k]>='A'&&a[k]<='N')) break;
k++;
}
printf("%02d:",a[k]<='9'?a[k]-'0':a[k]-'A'+10);
for(int i=0;;i++){
if(c[i]==d[i]&&(c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z'))
{
printf("%02d\n",i);
break;
}
}
return 0;
}