fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. Scanner fileIn = new Scanner(System.in);
  14. List<String> list = new ArrayList<>();
  15. while (fileIn.hasNext()) {
  16. list.add(fileIn.next());
  17. }
  18. Collections.sort(list);
  19. int pos = 0;
  20. while (pos != list.size()) {
  21. int next = pos+1;
  22. while (next != list.size() && list.get(pos).equals(list.get(next))) {
  23. next++;
  24. }
  25. if (next == pos+1) {
  26. System.out.println(list.get(pos));
  27. }
  28. pos = next;
  29. }
  30.  
  31. }
  32. }
Success #stdin #stdout 0.1s 2841600KB
stdin
this this is a a sentence sentence that does not not make sense a sentence not sentence not really really why not this a sentence not sentence a this really why
stdout
does
is
make
sense
that