Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
45064 木木老师 相对分子质量 Python3 Accepted 31 MS 3780 KB 390 2023-03-05 14:08:02

Tests(1/1):


Code:

n=int(input()) l=[] d={"H":1,"C":12,"N":14,"O":16,"F":19,"P":31,"S":32,"K":39} for i in range (n): m=input() l.append(m) for i in l: count=0 t=0 for j in range (len(i)): if i[j] in d: if t!=0: count+=t t=d[i[j]] else: count+=t*int(i[j]) t=0 count+=t print(count)