28 lines
356 B
Plaintext
28 lines
356 B
Plaintext
|
|
import random
|
||
|
|
r = random.randint(1, 10)
|
||
|
|
s=[]
|
||
|
|
s.sort()
|
||
|
|
result=[]
|
||
|
|
t=0
|
||
|
|
x=1
|
||
|
|
|
||
|
|
while t<8:
|
||
|
|
s.append(r)
|
||
|
|
r=random.randint(1, 10)
|
||
|
|
t+=1
|
||
|
|
|
||
|
|
s.sort()
|
||
|
|
t=0
|
||
|
|
|
||
|
|
for a in s:
|
||
|
|
t+=x
|
||
|
|
while t<len(s):
|
||
|
|
k = abs(a-s[t])
|
||
|
|
result.append(k)
|
||
|
|
t+=1
|
||
|
|
x+=1
|
||
|
|
t=0
|
||
|
|
|
||
|
|
for j in result:
|
||
|
|
if k < j:
|
||
|
|
print('(' + str(a) + ', ' + str(s[t]) + ')')
|