Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. n = input()
  2. y = []
  3. while len(y) <= (n**2)-n:
  4. x = map(int,raw_input().split())
  5. for i in range(n):
  6. y.append(x[i])
  7.  
  8. matriz=[]
  9. matriz1=[]
  10. for i in range(n):
  11. arroz=[]
  12. for k in range(n):
  13. arroz.append (y[0])
  14. del (y[0])
  15. matriz.append(arroz)
  16. matriz1.append(matriz[0])
  17.  
  18. diferente=[]
  19. #até aqui ta dando certo
  20. #ai eu tentei fazer código encontrar o diferente e ir apagando os iguais
  21. while True:
  22.  
  23. if sum(matriz[0]) = sum(matriz[(len(matriz))-1]) and sum(matriz[(len(matriz))-2]) = sum(matriz[0]):
  24. del (matriz[0])
  25. del (matriz[len(matriz)-1]
  26. del (matriz[len(matriz)-2]
  27. elif sum(matriz[0]) != sum(matriz[len(matriz)-1]) and sum(matriz[0]) = sum(matriz[len(matriz)-2]):
  28. diferente.append(matriz[len(matriz)-1])
  29. del (matriz[0])
  30. del (matriz[len(matriz)-1]
  31. del (matriz[len(matriz)-2]
  32. break
  33. elif sum(matriz[0]) = sum(matriz[len(matriz)-1]) and sum(matriz[0]) != sum(matriz[len(matriz)-2]):
  34. diferente.append(matriz[len(matriz)-2])
  35. del (matriz[0])
  36. del (matriz[len(matriz)-1]
  37. del (matriz[len(matriz)-2]
  38. break
  39. elif sum(matriz[0]) != sum(matriz[len(matriz)-1]) and sum(matriz[len(matriz)-1]) = sum(matriz[len(matriz)-2]):
  40. diferente.append(matriz[0])
  41. del (matriz[0])
  42. del (matriz[len(matriz)-1]
  43. del (matriz[len(matriz)-2]
  44. break
  45.  
  46. print diferente
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement