import fileinput f=open("1.txt","r") m=0 for i in range(100): s=f.readline() m+=int(s) print(m) 转载于:https://www.cnblogs.com/chif/p/9280837.html