forked from damaohongtu/JavaInterview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShopee_01.java
More file actions
33 lines (27 loc) · 728 Bytes
/
Shopee_01.java
File metadata and controls
33 lines (27 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package BiShi;
import java.util.HashMap;
import java.util.Scanner;
/**
* @Classname Shopee_01
* @Description TODO
* @Date 19-7-27 下午6:52
* @Created by mao<[email protected]>
*/
public class Shopee_01 {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
while(sc.hasNextLine()){
String s=sc.nextLine();
String[] nums=s.split(" ");
HashMap<String,Integer> tmp=new HashMap<>();
String res="";
for(String t:nums){
if(!tmp.containsKey(t)){
tmp.put(t,1);
res=res+t+" ";
}
}
System.out.println(res);
}
}
}