利用判断异常语句try...excpet来解决何时判断输入终止的问题 ans = [] try: while True: rand_num = int(input()) temp = set() for i in range(rand_num): temp.add(int(input())) temp = list(temp) temp.sort() ans.extend(temp) except: for elem in ans: print...