// Burton Rosenberg // Mon Jan 27 1998 // MaxN.java import java.io.* ; class MaxN { public static void main( String [] argv ) throws IOException { BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in)) ; System.out.print("Count: " ) ; int count ; count = Integer.parseInt(stdin.readLine()) ; if ( count<=0 ) { System.out.println("There is no maximum.") ; } else { int maxSoFar ; System.out.print("Number: " ) ; maxSoFar = Integer.parseInt(stdin.readLine()) ; count = count - 1 ; // count is the number of integers left to read while ( count > 0 ) { int i ; System.out.print("Number: " ) ; i = Integer.parseInt(stdin.readLine()) ; if ( i > maxSoFar ) { maxSoFar = i ; } count = count - 1 ; } System.out.println("The maximum is " + maxSoFar + "." ) ; } } }