Home

Java Stdin And Stdout II

Detailed explanation coming soon!

import java.util.*;

public class Solution {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double d = in.nextDouble();
        in.nextLine(); //clear \n token
        String s = in.nextLine();

        System.out.println("String: " + s);
        System.out.println("Double: " + d);
        System.out.println("Int: " + n);
    }
}


Questions? Have a neat solution? Comment below!