题解 | python解法
输入n个整数,输出其中最小的k个
https://www.nowcoder.com/practice/69ef2267aafd4d52b250a272fd27052c
while True:
try:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
n = a[1]
b = sorted(b)
for i in range(n):
print(b[i], end=' ')
except:
break
查看21道真题和解析