Day 1 :Data Types.
Solution In Java 8:
import java.io.*;import java.util.*;
public class Solution
{
public static void main(String[] args)
{
int i = 4;
double d = 4.0;
String s = "HackerRank ";
Scanner scan = new Scanner(System.in);
int i2 = scan.nextInt();
double d2 = scan.nextDouble();
scan.nextLine();
String s2 = scan.nextLine();
System.out.println(i+i2);
System.out.println(d+d2);
System.out.println(s+s2);
scan.close();
}
}
0 comments:
Post a Comment