Commit 58df8c93 by BellCodeEditor

save project

parent e6eae63f
Showing with 6 additions and 5 deletions
...@@ -2,14 +2,15 @@ with open(r'c:\Users\鲍\Desktop\145.txt','r',encoding='utf-8') as b: ...@@ -2,14 +2,15 @@ with open(r'c:\Users\鲍\Desktop\145.txt','r',encoding='utf-8') as b:
a=b.readlines() a=b.readlines()
#print(a) #print(a)
#file.colse() #file.colse()
c=[]
for i in a: for i in a:
i=i.split() i=i.split()
# print(i) # print(i)
sum=0 sum=0
c.append()
for l in i[1:]: for l in i[1:]:
sum=sum+int(l) sum=sum+int(l)
guil=i[0]+str(sum) guil=i[0]+str(sum)
# print(i[0]+str(sum)) c.append(guil)# print(i[0]+str(sum))
with open(r'C:\Users\鲍\Desktop','w',encoding='utf-8') as file: with open(r'c:\Users\鲍\Desktop\145.txt','a',encoding='utf-8') as b:
file=writelines(guil) b.writelines(c)
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment