题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
num = int(input()) ans = 0 s = set() while num != 0: if (num % 10) not in s: ans = ans * 10 + num % 10 s.add(num % 10) num //= 10 print(ans)
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
num = int(input()) ans = 0 s = set() while num != 0: if (num % 10) not in s: ans = ans * 10 + num % 10 s.add(num % 10) num //= 10 print(ans)
相关推荐