题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
while True: num = str(input())[::-1] # 将输入的int转为str,并反转 if num[0] == 0: continue # 输入的int最后一位不能为0,否则重新输入 else: new_int = '' for s in num: if s not in new_int: # 排除相同的数字 new_int += s print(int(new_int)) # 转为int,打印输出 break # 终止循环