Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import *
- n=int(input())
- a=n*[0]
- for i in range(n):
- a[i]=input()
- z=int(n/2)
- for i in range(z):
- b=randint(0,n-1)
- c=randint(0,n-1)
- while a[b]==0:
- b=randint(0,n-1)
- while a[c]==0 or a[b]==a[c]:
- c=randint(0,n-1)
- print(a[b],a[c])
- a[b]=0
- a[c]=0
Add Comment
Please, Sign In to add comment