Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = [int(i) for i in input().split()]
- y = [0]*len(x)
- for i in range (0, len(x)):
- if i == 0:
- previous = x[len(x)-1]
- else:
- previous = x[i-1]
- if i == len(x)-1:
- following = x[0]
- else:
- following = x[i+1]
- y[i] = previous + following
- for i in range(0, len(x)):
- print(y[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement