SHARE
TWEET

Untitled

a guest Jun 16th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def AppendCol(a, row, j, b):
  2.     for i in range(row):
  3.         b[i].append(a[i][j])
  4.  
  5.  
  6. row, col = map(int, input().split())
  7. a = []
  8. for i in range(row):
  9.     a.append([int(x) for x in input().split()])
  10. print()
  11. b = []
  12. rowb = row
  13. colb = col
  14. for i in range(row):
  15.     flag = False
  16.     for j in range(col):
  17.         if a[i][j] == 0:
  18.             flag = True
  19.     if flag:
  20.         b.append(a[0])
  21.         b.append(a[i])
  22.         rowb += 1
  23.     else:
  24.         b.append(a[i])
  25. for i in range(rowb):
  26.     for j in range(colb):
  27.         print(b[i][j],end = " ")
  28.     print()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top