题解 | #简单错误记录#
简单错误记录
https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb
lst01 = [] # 记录错误 lst02 = [] # 记录次数,index公用 while 1: try: s = input().split('\\')[-1] s1, s2 = s.split(' ') # s1:错误 s2:行号 s3 = s1[-16:] + ' ' + s2 if s3 not in lst01: lst01.append(s3) lst02.append(1) else: t = lst01.index(s3) lst02[t] += 1 except: break lst01 = lst01[-8:] lst02 = lst02[-8:] for i in range(len(lst01)): print(lst01[i], lst02[i])