以下是我的代码,希望指点
#include<stdio.h>
#include<string.h>
int main()
{
char day,hour,a[61],b[61],c[61],d[61];
int i,j,min;
scanf("%s%s%s%s",a,b,c,d);
for(i=0;i<strlen(a);i++)
{
if(a[i]==b[i]&&a[i]<='G'&&a[i]>='A')
{
day=a[i];
j=i;
break;
}
}
for(i=j+1;i<strlen(a);i++)
{
if(a[i]==b[i]&&((a[i]>='0'&&a[i]<='9')||(a[i]>='A'&&a[i]<='N')))
{
hour=a[i];
break;
}
}
for(i=0;i<strlen(c);i++)
{
if(c[i]==d[i]&&((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')))
{
min=i;
break;
}
}
switch(day)
{
case 'A':printf("MON ");break;
case 'B':printf("TUE ");break;
case 'C':printf("WED ");break;
case 'D':printf("THU ");break;
case 'E':printf("FRI ");break;
case 'F':printf("SAT ");break;
case 'G':printf("SUN ");break;
}
if(hour<='9'&&hour>='0')
printf("%.2d:",hour-'0');
else
printf("%d:",hour-'A'+10);
printf("%.2d",min);
}