Advertisement
Spocoman

07. House Painting

Aug 20th, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HousePainting {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double x = Double.parseDouble(scanner.nextLine());
  7.         double y = Double.parseDouble(scanner.nextLine());
  8.         double h = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double green = x * y * 2 - (1.5 * 1.5 * 2) + x * x * 2 - 1.2 * 2;
  11.         double red = 2 * (x * y) + 2 * (x * h / 2);
  12.  
  13.         System.out.printf("%.2f\n%.2f", green / 3.4, red / 4.3);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement