题解 | #字符串去重#

字符串去重

http://www.nowcoder.com/practice/f105c85ed9d44469986d56c27920639e

import java.util.HashSet; import java.util.Scanner;

public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String str = scanner.nextLine(); scanner.close(); HashSet hs = new HashSet<>();

    //write your code here......
    for(int i = 0;i<str.length();i++){
        hs.add(str.charAt(i));
    }
    for (char c:hs) {
        System.out.print(c);
    }
}

}

全部评论

相关推荐

06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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