=KEY:个人感觉这道题很多坑,一开始以为只要两个字符串中有相同的大写字母就行,后来发现是下标一一对应,然后几点的那俩字符还有可能是数字,最后的分还必须是字母相同对应的下标,最重要的是第一个有一个范围限制必须是A-G 第二个是A-N 第三个是符合isalpha() ------------对了数字对应是0-9的对应时间是00-09,坑可多了=
输入格式:
输入在 4 行中分别给出 4 个非空、不包含空格、且长度不超过 60 的字符串。
输出格式:
在一行中输出约会的时间,格式为 DAY HH:MM,其中 DAY 是某星期的 3 字符缩写,即 MON 表示星期一,TUE 表示星期二,WED 表示星期三,THU 表示星期四,FRI 表示星期五,SAT 表示星期六,SUN 表示星期日。题目输入保证每个测试存在唯一解。
输入样例:
3485djDkxh4hhGE
2984akDfkkkkggEdsb
s&hgsfdk
d&Hyscvnm
输出样例:
THU 14:04
string1=input()
string2=input()
string3=input()
string4=input()
Day={
"A":"MON","B":"TUE","C":"WED","D":"THU","E":"FRI","F":"SAT","G":"SUN"}
HH={"0":"00","1":"01","2":"02","3":"03","4":"04","5":"05","6":"06","7":"07","8":"08","9":"09","A":"10","B":"11","C":"12","D":"13","E":"14","F":"15","G":"16","H":"17","I":"18","J":"19","K":"20","L":"21","M":"22","N":"23"}
flag=0
for i in range(len(string1)):
if string1[i]==string2[i] and string1[i].isupper() and('A'<=string1[i]<='G') and flag==0:
day=string1[i]
flag=1
elif string1[i]==string2[i] and string1[i].isupper() and('A' <= string1[i] <= 'N') and flag==1:
hh=string1[i]
break
elif string1[i]==string2[i] and string1[i].isdigit() and flag==1:
hh=string1[i]
break
for i in range(len(string3)):
if string3[i]==string4[i] and string3[i].isalpha():
mm=i
string=''
if 0<=mm<=9:
mm=str(mm)
mm='0'+mm
else:
mm=str(mm)
string=Day.get(day,"nothing")+" "+HH.get(hh,"nothing")+":"+mm
print(string)