python3

提取不重复的整数

http://www.nowcoder.com/questionTerminal/253986e66d114d378ae8de2e6c4577c1

def func():
    while True:
        try:
            string = input().strip()
            result = string[::-1]
            string1 = ""
            for i in range(len(result)):
                if result[i] not in string1:
                    string1 += result[i]
            print(string1)
        except:
            break


if __name__ == "__main__":
    func()

全部评论
0好像没有考虑到
点赞 回复 分享
发布于 2021-11-14 19:19

相关推荐

2025-12-01 15:04
吉首大学 后端工程师
冲鸭2024:亚信不去也罢
点赞 评论 收藏
分享
2025-12-17 17:53
门头沟学院 Web前端
海梨花:我之前面试也是问我非技术问题,问过我怎么统计北京出租车数量,不借助任何网络或者其他平台的帮助,有足够多的人可以帮忙
点赞 评论 收藏
分享
评论
12
7
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务