galinyotsev123

ProgBasics02Simple-Operations-P07TriangleArea

Jan 12th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P07TriangleArea{
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double a = Double.parseDouble(scanner.nextLine());
  7. double h = Double.parseDouble(scanner.nextLine());
  8. double area = a * h / 2;
  9. System.out.printf("%.2f", area);
  10.  
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment