forked from SedaKunda/hackerrank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInOut2.java
More file actions
33 lines (25 loc) · 874 Bytes
/
InOut2.java
File metadata and controls
33 lines (25 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
For this exercise, you need to read inputs from stdin and print them to stdout.
Input Format
There are three lines of input.
Line one contains an integer.
Line two contains a double.
Line three contains a String.
Output Format
On the first line, print String: followed by the unaltered input String.
On the second line, print Double: followed by the unaltered input double.
On the third line, print Int: followed by the unaltered input integer.
*/
import java.util.Scanner;
public class InOut2 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
double y=sc.nextDouble();
sc.nextLine();
String s=sc.nextLine();
System.out.println("String: "+s);
System.out.println("Double: "+y);
System.out.println("Int: "+x);
}
}