#include<stdio.h>
#include<string.h>
int main(){
int i, j, len1, len2, ans[120]={0},tempweek, temphour, tempm;
char aa[65], bb[65], cc[65], dd[65];
char week[7][4]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
scanf("%s%s%s%s",aa,bb,cc,dd);
len1=strlen(aa); len2=strlen(bb);
if(len1>len2)len1=len2;
for(i=0;i<len1;i++){
if(aa[i]>='A'&&aa[i]<='G'&&aa[i]==bb[i]){tempweek=aa[i]-'A';break;}
}
for(j=i+1;j<len1;j++){
if(aa[j]<='9'&&aa[j]>='0'&&aa[j]==bb[j]){temphour=aa[j]-'0';break;}
if(aa[j]<='N'&&aa[j]>='A'&&aa[j]==bb[j]){temphour=aa[j]-'A'+10;break;}
}
len1=strlen(cc); len2=strlen(dd);
if(len1>len2)len1=len2;
for(i=0;i<len1;i++){
if(cc[i]>='A'&&cc[i]<='Z'&&cc[i]==dd[i]){tempm=i;break;}
if(cc[i]>='a'&&cc[i]<='z'&&cc[i]==dd[i]){tempm=i;break;}
}
printf("%s %02d:%02d\n",week[tempweek],temphour,tempm);
return 0;
}
PAT-A1061
最新推荐文章于 2020-11-26 10:51:28 发布