0
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.next(); 
        
        // Write your code here.

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

Above is my code.

My output is:

String: Welcome

Double: 3.1415

Int: 42

But the expected output would be like:

String: Welcome to HackerRank's Java tutorials!

Double: 3.1415

Int: 4

What is the problem?

khelwood
  • 55,782
  • 14
  • 81
  • 108

0 Answers0