Paste Search Dynamic
Recent pastes
BufferedReader reader
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6. import java.util.Set;
  7. import java.util.TreeSet;
  8.  
  9. public class Main {
  10.     public static  void main(string[] args) throws ioexception {
  11.         Set<String> s = new TreeSet<>();
  12.         bufferedreader reader = new bufferedreader(new inputstreamreader(system.in));
  13.         string text = "";
  14.         while((text = reader.readLine()) != null) {
  15.             string[] arr = text.split(" +");
  16.             for (int i = 0; i < arr.length; ++i) {
  17.                 s.add(arr[i]);
  18.             }
  19.         }
  20.         for (string i : s) {
  21.             system.out.println(i);
  22.         }
  23.         system.out.println(s.size());
  24.     }
  25. }
Parsed in 0.013 seconds