Java Stdin and Stdout I

  • + 24 comments
    Scanner sc=new Scanner(System.in);
    while(sc.hasNextInt()){
        int a=sc.nextInt();
        System.out.println(a);
    }
    

    is cleaner, especially if the test cases don't input 3 integers only...