// GameLoser.java (c) 2004 Kari Laitinen // This file is a solution to exercise 5-1. // www.naturalprogramming.com import java.util.* ; class GameLoser { public static void main( String[] not_in_use ) { Scanner keyboard = new Scanner( System.in ) ; int integer_from_keyboard ; int one_smaller_integer ; System.out.print( "\n This program is a computer game. Please, type in " + "\n an integer in the range 1 ... 2147483646 : " ) ; integer_from_keyboard = keyboard.nextInt( ) ; one_smaller_integer = integer_from_keyboard - 1 ; System.out.print( "\n You typed in " + integer_from_keyboard + "." + "\n My number is " + one_smaller_integer + "." + "\n I lost the game. You won. The game is over.\n") ; } }