Java Stdin and Stdout II

  • + 1 comment

    import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;

    public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner in=new Scanner(System.in);
        int a= in.nextInt();
        double b=in.nextDouble();
        in.nextLine();
        String c=in.nextLine();
        System.out.println("String: "+c);
        System.out.println("Double: "+b);
        System.out.println("Int: "+a);
    }
    

    } /*use in.nextLine() right after Double.Because when double reads it will discard "/n" character at the end of the the buffer which will be read by the nextLine().This is why so many test cases fail */