输入样例:
3485djDkxh4hhGE
2984akDfkkkkggEdsb
s&hgsfdk
d&Hyscvnm
输出样例:
THU 14:04
# -*- coding: utf-8 -*-
import stringweek = {'A': 'MON','B': 'TUE','C': 'WED','D': 'THU','E': 'FRI','F': 'SAT','G': 'SUN'}hour = {'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'}if __name__ == '__main__':input_strs = []for i in range(4):input_strs.append((input()).strip())flag = 0for i in range(min(len(input_strs[0]), len(input_strs[1]))):if input_strs[0][i] == input_strs[1][i] and \input_strs[0][i] in list(string.ascii_uppercase)[0:7] and \flag == 0:print(week[input_strs[0][i]], end=' ')flag = 1elif input_strs[0][i] == input_strs[1][i] and \(input_strs[0][i] in list(string.ascii_uppercase)[0:14] orinput_strs[0][i] in list(map(str, list(range(10))))) and \flag == 1:print(hour[input_strs[0][i]], end=':')breakfor i in range(min(len(input_strs[2]), len(input_strs[3]))):if input_strs[2][i] == input_strs[3][i] and \input_strs[2][i] in (list(string.ascii_uppercase) + list(string.ascii_lowercase)):print('%02d' % i, end='')break