题解 | #明明的随机数#

明明的随机数

http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
             int n=Integer.parseInt(sc.nextLine());
        TreeSet<Integer> set=new TreeSet<>(); 
        for(int i=0;i<n;i++){
            set.add(Integer.parseInt(sc.nextLine()));
        }
        for(int num : set){
            System.out.println(num);
        }
        }
       
    }
}
全部评论

相关推荐

程序员牛肉:你这其实一点都没包装,标准的流水线产品。 实习现在不一定能解决你的问题,你太浮躁了。你看了多少源码?看了多少技术博客?真的没必要这么浮躁的着急找实习,沉下心来学习
投递实习岗位前的准备
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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