In this HackerRank Java Stdin and Stdout I problem in the java programming language, you must read 3 integers from stdin and then print them to stdout. Each integer must be printed on a new line.

HackerRank Java Stdin and Stdout I solution


HackerRank Java Stdin and Stdout I problem solution

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        // Complete this line
        int b = scan.nextInt();
        // Complete this line
        int c = scan.nextInt();

        System.out.println(a);
        // Complete this line
        System.out.println(b);
        // Complete this line
        System.out.println(c);
    }
}


The solution in Java 8 programming.

import java.util.*;

public class Solution {

    public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();	
		System.out.println(a);
		System.out.println(b);
		System.out.println(c);
		
    
    }
}