Advertisement
MilaDimitrovaa

Homework (Trapec)

Oct 18th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Trapec1 {
  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 h = scan.nextDouble();
  13.         System.out.println("h:" + h );
  14.         double S = (a + b) / 2 *h;
  15.         System.out.println("S=" + S);
  16.        
  17.        
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement