fork download
  1. import java.io.*;
  2. import java.util.*;
  3. import java.text.*;
  4. import java.math.*;
  5. import java.util.regex.*;
  6.  
  7. class Solution {
  8.  
  9. public static void main(String[] args) {
  10. int i = 4;
  11. double d = 4.0;
  12. String s = "HackerRank ";
  13.  
  14. Scanner scan = new Scanner(System.in);
  15.  
  16. /* Declare second integer, double, and String variables. */
  17. int j=scan.nextInt();
  18. /* Read and save an integer, double, and String to your variables.*/
  19. double k=scan.nextDouble();
  20. //scan.nextLine();
  21. String str=scan.nextLine();
  22. /* Print the sum of both integer variables on a new line. */
  23. System.out.println(i+j);
  24. /* Print the sum of the double variables on a new line. */
  25. System.out.println(d+k);
  26. /* Concatenate and print the String variables on a new line;
  27. the 's' variable above should be printed first. */
  28.  
  29. System.out.println(s+ "" +str);
  30.  
  31. scan.close();
  32. }
  33. }
Success #stdin #stdout 0.08s 4386816KB
stdin
5
7.00 random one
stdout
9
11.0
HackerRank  random one