首页 > 其他 > 详细

NYOJ题目839合并

时间:2016-08-31 11:51:42      阅读:222      评论:0      收藏:0      [点我收藏+]

技术分享

---------------------------

AC代码:

 1 import java.util.Scanner;
 2 
 3 public class Main {
 4 
 5     public static void main(String[] args) {
 6         
 7         
 8         Scanner sc=new Scanner(System.in);
 9         
10         int times=sc.nextInt();
11         while(times-->0){
12             
13             int n=sc.nextInt();
14             int book[]=new int[100];
15             
16             for(int i=0;i<n*2;i++){
17                 book[sc.nextInt()]=1;
18             }
19 
20             for(int i=0;i<book.length;i++){
21                 if(book[i]==1) System.out.print(i+" ");
22             }
23             System.out.println();
24             
25         }
26         
27     }
28     
29 }

 

题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=839

NYOJ题目839合并

原文:http://www.cnblogs.com/cc11001100/p/5825069.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!