题解 | #输入n个整数,输出其中最小的k个#
输入n个整数,输出其中最小的k个
https://www.nowcoder.com/practice/69ef2267aafd4d52b250a272fd27052c
# 两个整数n和k line = input() n, k = map(int, line.split(" ")) # 一个整数数组 line = input() arr = list(map(int, line.split(" "))) arr.sort() for i in range(k): print(arr[i], end=" ")