//分发礼物 public class IDreward {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         int n = sc.nextInt();         LinkedHashSet<Integer> set = new LinkedHashSet<>();         for (int i = 0; i < n; i++) {             set.add(sc.nextInt());         }         List<Integer> list = new LinkedList<>(set);         int m = Math.min(10, list.size());         System.out.println(m);         for (int i = 0; i < m; i++) {             System.out.println(list.get(i));         }     } }
点赞 评论

相关推荐

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