题解 | #输入n个整数,输出其中最小的k个#
输入n个整数,输出其中最小的k个
https://www.nowcoder.com/practice/69ef2267aafd4d52b250a272fd27052c
while True: try: s=input().split() s_nums=input() n,k=int(s[0]),int(s[1]) nums=[int(num) for num in s_nums.split()] #print(type(nums)) nums.sort() k_nums=nums[:k] for i in k_nums: print(i,end=' ') except: break