fork 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. int x=1, n;
  10. Scanner in = new Scanner(System.in);
  11. n = in.nextInt();
  12. while ((n/=10) > 0)
  13. {
  14. x++;
  15. }
  16. System.out.println(x);
  17. }
  18. }
Success #stdin #stdout 0.09s 29268KB
stdin
7025
stdout
4