Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Java21 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.print("a = ");
- double a = scan.nextInt();
- System.out.print("b = ");
- double b = scan.nextInt();
- double S = a + b;
- double P = 2 * (a + b);
- System.out.print("S = " + S + "square cm\n");
- System.out.print("P = " + P + "cm");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement