Menu Close

python 习题14

%title插图%num

 

Solution:

d= [int(x) for x in input().split()]

print(“0”, d[0], d[0] + d[1], d[0] + d[1] + d[2], d[0] + d[1] + d[2] + d[3])

print(d[0], “0”, d[1], d[1] + d[2], d[1] + d[2] + d[3])

print(d[0] + d[1], d[1], “0”, d[2], d[2] + d[3]) print (d[0] + d[1] + d[2], d[1] + d[2], d[2], “0”, d[3])

print(d[0] + d[1] + d[2] + d[3], d[1] + d[2] + d[3], d[2] + d[3], d[3], “0”)

 

Posted in Python

发表评论

相关链接