n, k = map(int, input().split())
num = [int(i) for i in input().split()]
a = sorted(num)[0:k]
print(' '.join([str(i) for i in a]))
#注意,输出时,.join的对象必须是str()类型,如果是int,需要先将int转换为str
num = [int(i) for i in input().split()]
a = sorted(num)[0:k]
print(' '.join([str(i) for i in a]))
#注意,输出时,.join的对象必须是str()类型,如果是int,需要先将int转换为str
我已经通过这道题!
https://gw-c.nowcoder.com/api/sparta/jump/link?link=https%3A%2F%2Fwww.nowcoder.com%2FquestionTerminal%2F69ef2267aafd4d52b250a272fd27052c
全部评论
相关推荐