In this challenge, you must read integers from stdin and then print them to stdout. Each integer must be printed on a new line. To make the problem a little easier, solution of code is provided for you in the editor below.
Here is the solution to above challenge;
Copy to Clipboard
x
1
Input Format
2
3
There are lines of input, and each line contains a single integer.
4
5
Sample Input
6
7
42
8
100
9
125
Copy to Clipboard
19
1
import java.util.*;
2
3
public class Solution {
4
5
public static void main(String[] args) {
6
Scanner scan = new Scanner(System.in);
7
int a = scan.nextInt();
8
int b = scan.nextInt();
9
int c = scan.nextInt();
10
// Complete this line
11
// Complete this line
12
13
System.out.println(a);
14
System.out.println(b);
15
System.out.println(c);
16
// Complete this line
17
// Complete this lines
18
}
19
}
Copy to Clipboard
5
1
Sample Output
2
3
42
4
100
5
125
Leave A Comment