2015-09-28 15:11

# 浙大PAT乙级的一道题（1004 福尔摩斯的约会），牛客网上怎么都通不过

1

3485djDkxh4hhGE

2984akDfkkkkggEdsb

s&hgsfdk

d&Hyscvnm

THU 14:04

#include

#define MAX 61
int main()
{
int i, j, temp;
char a[MAX], b[MAX], c[MAX], d[MAX];
gets(a);
gets(b);
gets(c);
gets(d);
for(i = 0; i < MAX-1; i ++)
{
if(a[i] == b[i])
{
switch(a[i])
{
case 'A':printf("MON ");j = 1;break;
case 'B':printf("TUE ");j = 1;break;
case 'C':printf("WED ");j = 1;break;
case 'D':printf("THU ");j = 1;break;
case 'E':printf("FRI ");j = 1;break;
case 'F':printf("SAT ");j = 1;break;
case 'G':printf("SUN ");j = 1;break;
default:break;
}
}
if(1 == j)
{
temp = i;
i = MAX;
}
}
for(i = temp+1; i < MAX-1; i ++)
{
if((a[i] == b[i]) && (((a[i]-'0') <= 9) && ((a[i]-'0') >= 0)))
{
printf("%02d:", a[i]-'0');
j = 2;
}
if((a[i] == b[i]) && ((a[i] <= 'N') && (a[i] >= 'A')))
{
printf("%d:", a[i]-'7');
j = 2;
}
if(2 == j)
i = MAX;
}
for(i = 0; i < MAX-1; i ++)
{
if((c[i] == d[i]) && (((c[i] <= 'Z') && (c[i] >= 'A')) || ((c[i] <= 'z') && (c[i] >= 'a'))))
{
printf("%02d", i);
j = 3;
}
if(3 == j)
i = MAX;
}
return 0;
}

3485djDkxh4hhGE

2984akDfkkkkggEdsb

s&hgsfdk

d&Hyscvnm

• 点赞
• 写回答
• 关注问题
• 收藏
• 复制链接分享
• 邀请回答