Commit aabae69c by BellCodeEditor

save project

parent 9e4072ec
Showing with 1 additions and 1 deletions
......@@ -7,7 +7,7 @@ for i in a: #用for...in...把每一行的数据遍历
data=i.split()#把字符串切分成更细的一个个的字符串
sum=0 #先把总钱设为0
for s in data[1:]:#遍历列表中第1个数据和之后的数据
sum=sum+int(s)#然后依次相加起来,但s是字符串
sum=sum+int(s)
sb=data[0]+str(sum)+'\n'
final_sum.append(sb)
......
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