fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. String sin = in.nextLine();
  11. StringBuffer str = new StringBuffer(sin);
  12. char si;
  13. for (int i=0; i<str.length(); i++){
  14. si=str.charAt(i);
  15. if ((si>='a'&&si<='z')||(si>='A'&&si<='Z')){
  16. str.deleteCharAt(i); i--;
  17. }
  18. }
  19. System.out.printf("%s",str);
  20. }
  21. }
Success #stdin #stdout 0.15s 321344KB
stdin
zdfgzdfg987w435kjwbsdf987w345D345
stdout
987435987345345