Java Stdin and Stdout I

Sort by

recency

|

587 Discussions

|

  • + 0 comments

    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 a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        System.out.println(a);
            System.out.println(b);
                System.out.println(c);
        sc.close();
    }
    

    }

  • + 0 comments

    Java is one of the most reliable and versatile programming languages out there. 11xplay ID

  • + 1 comment
    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 scanner = new Scanner(System.in);
            while (scanner.hasNext()) {
                System.out.println(scanner.nextInt());
            }
            scanner.close();
        }
    }
    
  • + 0 comments

    import java.util.*;

    public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int  b=scan.nextInt();
        int a = scan.nextInt();
        int c = scan.nextInt();
    
        System.out.println(b+"\n"+a+"\n"+c);
    }
    

    }

  • + 0 comments

    Absolutely! Understanding how to work with standard input and output is crucial for solving HackerRank challenges effectively. Gurubhai247 Login ID and Password