inNumber = input().strip() out = '' #从字符串尾部开始遍历,遇到出现过的数字则跳过 nums =[] for i in range(len(inNumber)-1,-1,-1): if inNumber[i] in nums: continue else: out = out + inNumber[i] nums.append(inNumber[i]) print(out)
inNumber = input().strip() out = '' #从字符串尾部开始遍历,遇到出现过的数字则跳过 nums =[] for i in range(len(inNumber)-1,-1,-1): if inNumber[i] in nums: continue else: out = out + inNumber[i] nums.append(inNumber[i]) print(out)