Advertisement
Ivan18113

trapeze

Oct 7th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Трапец {
  3.  
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. System.out.print("a = ");
  7. double a = scan.nextInt();
  8. System.out.print("b = ");
  9. double b = scan.nextInt();
  10. System.out.print("h = ");
  11. double h = scan.nextInt();
  12. double S = ((a + b)*h) / 2;
  13. System.out.print("S = " + S + "square cm");
  14.  
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement