Java Stdin and Stdout II

Sort by

recency

|

1217 Discussions

|

  • + 0 comments

    Java is such a versatile and powerful language—it's amazing how it's still going strong after all these years. betguru247.net

  • + 0 comments
    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);
            
            scan.close();
        }
    }
    
  • + 0 comments

    Java is a powerful, object-oriented programming language known for its portability, security, and scalability. betguru247net

  • + 0 comments

    This problem solution

  • + 0 comments

    We can also use

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