fork download
  1. import java.util.Scanner;
  2.  
  3. class Ideone
  4. {
  5. public static void main (String[] args)
  6. {
  7. Scanner sc = new Scanner(System.in);
  8. while(sc.hasNextInt())
  9. System.out.printf("input was: %d\n",sc.nextInt());
  10. sc.close();
  11. }
  12. }
Success #stdin #stdout 0.11s 380672KB
stdin
1
12
23
34
stdout
input was: 1
input was: 12
input was: 23
input was: 34