Advertisement
1nikitas

Untitled

Apr 12th, 2020
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. inputt = input()
  2. a = []
  3. while inputt != 'end':
  4.     a.append([int(i) for i in inputt.split()])
  5.     inputt = input()
  6.     n = len(a)
  7.     m = len(a[0])
  8. for i in range(n):
  9.     for j in range(m):
  10.         j = a[(i - 1) % n][j] + a[(i + 1) % n][j] + a[i][(j - 1) % m] + a[i][(j + 1) % m]
  11.         print(j, end=" ")
  12.     print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement