MilaDimitrovaa

Homework (Pravougulnik)

Oct 18th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Pravougulnik1 {
  4.  
  5.     public static void main(String[] args) {
  6.        
  7.         Scanner scan = new Scanner(System.in);
  8.         double a = scan.nextDouble();
  9.         System.out.println("a:" + a);
  10.         double b = scan.nextDouble();
  11.         System.out.println("b:" + b);
  12.         double P = 2 * (a + b);
  13.         double S = a*b;
  14.         System.out.println("P=" + P);
  15.         System.out.println("S=" + S);
  16.        
  17.  
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment