1014 福尔摩斯的约会 (20 分)
#include<stdio.h>
#include<string.h>
int main()
{
int i,flag=0;
char a[4][61],b[7][4]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
memset(a,'\0',sizeof(a));
for(i=0;i<4;i++)
if(scanf("%s",a[i]));
for(i=0;i<strlen(a[0]);i++)
{
if(!flag&&(a[0][i]==a[1][i])&&(a[0][i]>='A')&&(a[0][i]<='G'))
{
printf("%s ",b[a[0][i]-'A']);
flag=1;
}
else if(flag&&(a[0][i]==a[1][i])&&((a[0][i]>='0')&&(a[0][i]<='9')))
{
printf("%02d:",a[0][i]-'0');
break;
}
else if(flag&&(a[0][i]==a[1][i])&&((a[0][i]>='A')&&(a[0][i]<='N')))
{
printf("%02d:",a[0][i]-'A'+10);
break;
}
}
for(i=0;i<strlen(a[2]);i++)
{
if((a[2][i]==a[3][i])&&(((a[2][i]>='A')&&(a[2][i]<='Z'))||((a[2][i]>='a')&&(a[2][i]<='z'))))
{
printf("%02d",i);
break;
}
}
return 0;
}