如下:
import numpy as np
# n = int(input('请输入一个整数:'))
with open('input.txt','r') as f:
n = int(f.readline())
f.close()
s = []
while True:
for i in range(n):
r = np.random.randint(1000,1000+20*n)
s.append(r)
if len(s) == len(set(s)):
break
s.sort(reverse=True)
print(s)
f1=open("output.txt","w")
for i in s:
f1.write(str(i)+'\n')
f1.close()