// Burton Rosenberg // Mon Feb 9 1998 // ToDigit.java import java.io.* ; class ToDigit { public static void main( String [] argv ) throws IOException { BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in)) ; System.out.print("Input: " ) ; String s = stdin.readLine() ; int i = 0 ; while ( i < s.length() ) { char c = s.charAt(i) ; System.out.println("Character " + c + " is digit " + toDigit(c) + "." ) ; i = i + 1 ; } } static int toDigit( char c ) { if ( c < '0' ) return -1 ; if ( c > '9' ) return -1 ; return c-'0' ; } }