题解 | 输入整型数组和排序标识,对其元素按照升序或降序进行排序
import re def queue_dig(m,g): new_m = m.split() new1_m = [int(num) for num in new_m] new2_m= sorted(new1_m) if g == 0: return ' '.join(map(str,new2_m)) if g == 1: return ' '.join(map(str, new2_m[::-1])) n = input() m = input().strip() g = int(input().strip()) print(queue_dig(m,g))