题解 | #提取不重复的整数#
输入整型数组和排序标识,对其元素按照升序或降序进行排序
http://www.nowcoder.com/practice/dd0c6b26c9e541f5b935047ff4156309
num=int(input()) List=input().split() rank=int(input())
NList=[] for i in List: NList.append(int(i))#字符串变数字
for i in range(int(num)):#排序 for j in range(i+1,int(num)): if NList[i] > NList[j]: NList[i],NList[j] = NList[j],NList[i] #print(NList) if rank==0: MList= NList elif rank==1: MList= NList[::-1]
for i in MList: print(i,end=' ')