#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int min(int a,int b); int min(int a,int b){ return a<b?a:b; } int main() { char a[61],b[61],c[61],d[61]; scanf("%s %s %s %s",a,b,c,d); int flag=0; for(int i=0;i<min(strlen(a),strlen(b));i++){ if((a[i]==b[i])&&((a[i]>=65&&a[i]<=71)&&(flag==0))){ flag++; if(a[i]=='A'){ printf("MON "); }else if(a[i]=='B'){ printf("TUE "); }else if(a[i]=='C'){ printf("WED "); }else if(a[i]=='D'){ printf("THU "); }else if(a[i]=='E'){ printf("FRI "); }else if(a[i]=='F'){ printf("SAT "); }else if(a[i]=='G'){ printf("SUN "); } continue; } if((flag==1)&&(a[i]==b[i])&&((a[i]>=48&&a[i]<=57)||(a[i]>=65&&a[i]<=78))){ if(a[i]>=48&&a[i]<=57){ printf("0"); printf("%c",a[i]); } else if(a[i]>=65&&a[i]<=78){ printf("%d",(int)(a[i]-55)); } break; } } printf(":"); for(int j=0;j<min(strlen(c),strlen(d));j++){ if((c[j]==d[j])&&((c[j]>=65&&c[j]<=90)||(c[j]>=97&&c[j]<=122))){ if(j>=0&&j<=9){ printf("0%d",j); }else{ printf("%d",j); } break; } } return 0; }
标签:pat,int,福尔摩斯,65,&&,1014,include From: https://www.cnblogs.com/Npc-Hb/p/17161369.html