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.math.*;
  7. import java.util.stream.*;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. BigInteger number = new BigInteger("12345678910111213141516171819");
  15. List<Integer> res = number
  16. .toString()
  17. .chars()
  18. .mapToObj(c -> Character.digit(c, 10))
  19. .collect(Collectors.toList());
  20. for (int i = 0 ; i != res.size() ; i++) {
  21. System.out.println(res.get(i));
  22. }
  23. }
  24. }
Success #stdin #stdout 0.21s 320832KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7
8
9
1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9