题目:
(ps:乙级的一道原题,直接copy过来用了,贴在此处~)#include#include int Min(int a,int b);int main(){ char s1[70],s2[70],s3[70],s4[70]; int i,hour,minute,len,tag=0,add=0; char ch1,ch2,time[24]={ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N'}; scanf("%s",s1); scanf("%s",s2); scanf("%s",s3); scanf("%s",s4); len=Min(strlen(s1),strlen(s2)); for(i=0;i ='A'&&s1[i]<='G')){ch1=s1[i];tag++;continue;} if(tag==1&&s1[i]==s2[i]&&((s1[i]>='0'&&s1[i]<='9')||(s1[i]>='A'&&s1[i]<='N'))){ch2=s1[i];tag++;} if(tag==2)break; } switch(ch1){ 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; } len=Min(strlen(s3),strlen(s4)); for(i=0;i ='a'&&s3[i]<='z')||(s3[i]>='A'&&s3[i]<='Z')))break; } minute=i; if(minute>=60){add=minute/60;minute=minute%60;} for(hour=0;hour<24;hour++){ if(time[hour]==ch2)break; } hour=(hour+add)%24; if(hour<=9)printf("0%d:",hour); else printf("%d:",hour); if(minute<=9)printf("0%d",minute); else printf("%d",minute);}int Min(int a,int b){ int t; t=a