We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
import java.util.Scanner;
public class Solution {
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int a = Integer.parseInt(scan.nextLine());
double b = Double.parseDouble(scan.nextLine());
String c = scan.nextLine();
System.out.println("String: " + c + "\nDouble: " + b + "\nInt: " + a);
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Stdin and Stdout II
You are viewing a single comment's thread. Return to all comments →
The best practice is to use parser