题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
n = input()[::-1] # 直接反转字符串 s = "" # 定义空字符串 if int(n[0]) != 0: # 判断字符串首位不是0 for i in n: if i not in s: s += i print(int(s))
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
n = input()[::-1] # 直接反转字符串 s = "" # 定义空字符串 if int(n[0]) != 0: # 判断字符串首位不是0 for i in n: if i not in s: s += i print(int(s))
相关推荐