양의 정수만 입력한다는 가정 하에
public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int no; int n = stdIn.nextInt(); while(n>=1){ n = n/10; no++; } System.out.print("result : "+no); }