fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.text.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. float v = 23.51F;
  14. df.setMaximumFractionDigits(8);
  15. char[] d = df.format(v).toCharArray();
  16. int count = 0;
  17. for (int i = 0 ; i != d.length ; i++) {
  18. if (Character.isDigit(d[i])) {
  19. count++;
  20. }
  21. }
  22. int[] res = new int[count];
  23. int pos = 0;
  24. for (int i = 0 ; i != d.length ; i++) {
  25. if (Character.isDigit(d[i])) {
  26. res[pos++] = Character.digit(d[i], 10);
  27. }
  28. }
  29. for (int i = 0 ; i != res.length ; i++) {
  30. System.out.println(res[i]);
  31. }
  32. }
  33. }
Success #stdin #stdout 0.06s 321344KB
stdin
Standard input is empty
stdout
2
3
5
1
0
0
0
0
2
3