题解 | #明明的随机数#
明明的随机数
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
import sys import random n = int(input()) vals = [] vals_unique = [] for i in range(n): val = int(input()) vals.append(val) for val in vals: if val not in vals_unique: vals_unique.append(val) #也可使用集合去重 #vals_unique=list(set(vals)) result_list = sorted(vals_unique) for result in result_list: print(result)