AcWing 1547. 约会
原题链接
简单
作者:
李sir
,
2021-03-18 16:27:36
,
所有人可见
,
阅读 315
#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 days[7][7]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
printf("%s ",days[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]>='A'?a[k]-'A'+10:a[k]-'0');
for(int i=0;;i++)
{
if (c[i] == d[i] && (c[i] >= 'a' && c[i] <= 'z' || c[i] >= 'A' && c[i] <= 'Z'))
{
printf("%02d",i); break;
}
}
return 0;
}