Java Stdin and Stdout II

Sort by

recency

|

1209 Discussions

|

  • + 0 comments

    solution

  • + 0 comments

    Java might not be the flashiest language, but it gets the job done—rock solid for backend stuff and still super relevant. myfairplay24.in

  • + 0 comments

    Java is a powerful, versatile programming language that has stood the test of time! Skyexchange signup

  • + 1 comment

    import java.util.Scanner;

    public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int i = scan.nextInt();
        double d = scan.nextDouble();
        scan.nextLine();
        String s = scan.nextLine();
    
        System.out.println("String: " + s);
        System.out.println("Double: " + d);
        System.out.println("Int: " + i);
    }
    

    }

  • + 0 comments

    This is my solution :

    import java.io.; import java.util.;

    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 sc = new Scanner(System.in);
    
        int x = sc.nextInt();
        double y = sc.nextDouble();
        sc.nextLine();
    
        String z = sc.nextLine();
    
    
        System.out.println("String: " + z);
        System.out.println("Double: " + y);
        System.out.println("Int: " + x);
    }
    

    }