class PrintDigits { public static void printDigits(int N) { int digits[]; // int is definitely less than 32 decimal digits digits = new int[32]; int j = 0; // j is the next unfilled location of the array while(N > 0) { int d = N%10; N = N/10; digits[j] = d; j++; } // End while() for(int i = j-1; i >= 0; i--) { System.out.println(digits[i]); } // End for(j) } // End printDigits() public static void main(String[] args) { int N = Integer.parseInt(args[0]); printDigits(N); } // End main() } // End class PrintDigits