forked from alexanderscott/HackerRank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdin.java
More file actions
33 lines (26 loc) · 761 Bytes
/
Copy pathstdin.java
File metadata and controls
33 lines (26 loc) · 761 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
// https://www.hackerrank.com/challenges/java-stdin
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int c = 0;
int i = 0;
double d = 0.00;
String s = "";
while(in.hasNext())
{
if (c == 0) { i = in.nextInt(); }
if (c == 1) { d = in.nextDouble(); }
if (c > 1) { s = in.nextLine(); }
c++;
}
System.out.println("String: " + s);
System.out.println("Double: " + d);
System.out.println("Int: " + i);
}
}