Input Format
- The first line contains an integer, .
- The second line contains a double, .
- The third line contains a string, .
Output Format
Print the sum of both integers on the first line, the sum of both doubles (scaled to decimal place) on the second line, and then the two concatenated strings on the third line.Here is my code
package programs;
import java.util.Scanner;
public class Solution1 {
public static void main(String[] args) {
int i = 4;
double d = 4.0;
String s = "Programs ";
Scanner scan = new Scanner(System.in);
int i1 = scan.nextInt();
double d1 = scan.nextDouble();
String s1 = scan.next();
int i2 = i + i1;
double d2 = d + d1;
String s2 = s + s1;
System.out.println(i2);
System.out.println(d2);
System.out.println(s2);
scan.close();
}
}
Input (stdin)
12
4.0
are the best way to learn and practice coding!
Your Output (stdout)
16
8.0
programs are
Expected Output
16
8.0
programs are the best place to learn and practice coding!