题解 | #字符串排序#
输入n个整数,输出其中最小的k个
http://www.nowcoder.com/practice/69ef2267aafd4d52b250a272fd27052c
n , k = map(int, input().split(" "))
temp_list = input().split(" ")
temp_list = list(map(int, temp_list))
for i in sorted(temp_list,reverse=False)[0:k]:
print(i, end=" ")
查看9道真题和解析