PAT——甲级1061(字符串)

#include
#include
#include
using namespace std;
int main()
{
   char a[100],b[100],c[100],d[100];
   scanf("%s",a);
   scanf("%s",b);
   scanf("%s",c);
   scanf("%s",d);
   char week[7][5]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
   int l1=strlen(a);
   int l2=strlen(b);
   int l3=strlen(c);
   int l4=strlen(d);
   int i;
   for(i=0;i='A'&&a[i]<='G'))
       {
           printf("%s ",week[a[i]-'A']);
           break;
       }
   }
   for(i++;i='0'&&a[i]<='9')
        {printf("%02d:",a[i]-'0');
        break;}
       else if(a[i]>='A'&&a[i]<='N')
       {printf("%d:",a[i]-'A'+10);
       break;
       }
       }
   }
   for( i=0;i='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')))
       {
           printf("%02d\n",i);
       }
   }
   return 0;
}

理清题意

题目小陷阱非常多

弄清顺序

你可能感兴趣的:(PAT——甲级1061(字符串))