版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Lichengguang_std/article/details/81674371
while True:
try:
a,b,c=input(),map(int,input().split()),input()
if c=='0':
print(" ".join(map(str,sorted(b))))
if c=='1':
print(" ".join(map(str,sorted(b,reverse=True))))
except:
break