Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HousePainting {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double x = Double.parseDouble(scanner.nextLine());
- double y = Double.parseDouble(scanner.nextLine());
- double h = Double.parseDouble(scanner.nextLine());
- double green = x * y * 2 - (1.5 * 1.5 * 2) + x * x * 2 - 1.2 * 2;
- double red = 2 * (x * y) + 2 * (x * h / 2);
- System.out.printf("%.2f\n%.2f", green / 3.4, red / 4.3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement