题解
输入整型数组和排序标识,对其元素按照升序或降序进行排序
https://www.nowcoder.com/practice/dd0c6b26c9e541f5b935047ff4156309
a = int(input())
b = list(map(int,input().split()))
c = int(input())
b1 = []
if c == 0:
b.sort()
for i in b:
i = str(i)
b1.append(i)
print(' '.join(b1))
else:
b.sort()
b.reverse()
for i in b:
i = str(i)
b1.append(i)
print(' '.join(b1))
