Advertisement
alekc23

Untitled

Oct 22nd, 2019
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class cd {
  3.  
  4.     public static void main(String[] args) {
  5.  Scanner   scan = new Scanner(System.in);
  6.        
  7.         System.out.print("Въведи a: ");
  8.         double a = scan.nextDouble();
  9.  
  10.         System.out.print("Въведи b: ");
  11.         double b = scan.nextDouble();
  12.        
  13.         double perimeter = 2 * (a + b);
  14.         double area = a * b;
  15.  
  16.         System.out.println("Периметър: " + perimeter);
  17.         System.out.print("Лице: " + area);
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement