Demo entry 6718399

javajungol

   

Submitted by dd on Mar 04, 2018 at 07:53
Language: Java. Code size: 596 Bytes.

import java.util.ArrayList;
import java.util.Scanner;
public class Main1535 {
	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		ArrayList<String> array = new ArrayList<>();
		String[] arr;
		String s;
		StringBuilder sb = new StringBuilder();
		while(true){
			s = input.nextLine();
			if(s.equals("END")) break;
			arr = s.split(" ");
			for(int i =0;i<arr.length;i++){
				if(array.contains(arr[i])) continue;
				array.add(arr[i]);
				sb.append(arr[i]);
				sb.append(" ");
			}
			System.out.println(sb.toString());
		}
	}

}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).