Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement