import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); HashSet<Integer>arr=new HashSet<Integer>(); int n=sc.nextInt(); for (int i = 0; i < n; i++) { arr.add(sc.nextInt()); } Integer[]a=arr.toArray(new Integer[0]); Arrays.sort(a); int len=a.length; System.out.println(len); for (int i = 0; i <len; i++) { System.out.print(a[i]+" "); } } }
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:552 |
C语言训练-大、小写问题 (C语言代码)浏览:2349 |
剪刀石头布 (C语言代码)浏览:1747 |
完数 (C语言代码)浏览:685 |
关于C语言变量位置的问题浏览:272 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:511 |
1052题解(链表操作)浏览:651 |
青年歌手大奖赛_评委会打分 (C语言代码)浏览:2139 |
1073题解浏览:619 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:580 |