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