fork(1) download
  1.  
  2. import java.util.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8. String line ;
  9. try{
  10. char fr[] = new char[26] ;
  11. while((line = reader.readLine()) != null){
  12. for(int i = 0 ; i < line.length() ; i++){
  13.  
  14. for(int j = i + 1 ; j < line.length() ; j++ ){
  15. if( line.charAt(i) == line.charAt(j) ){
  16. fr[i] = line.charAt(i) ;
  17.  
  18. }else{
  19. fr[i] = fr[i + 1] ;
  20. }
  21. }
  22. System.out.print(fr[i]);
  23. }
  24.  
  25. }
  26.  
  27. }catch(Exception e){
  28. e.printStackTrace();
  29. }
  30. }
  31. }
Success #stdin #stdout 0.07s 45008KB
stdin
boos
stdout