Advertisement
uktcar

01.3.01TrapeziodArea

Mar 6th, 2023 (edited)
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ex01TrapeziodArea {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         double b1 = Double.parseDouble(scan.nextLine());
  8.         double b2 = Double.parseDouble(scan.nextLine());
  9.         double h = Double.parseDouble(scan.nextLine());
  10.  
  11.         double square = (b1 + b2) * h / 2;
  12.  
  13.         System.out.printf("%.2f", square);
  14.  
  15.     }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement