Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int x = Integer.parseInt(scanner.nextLine()),
- y = Integer.parseInt(scanner.nextLine()),
- nonPaint = Integer.parseInt(scanner.nextLine());
- double neededPaint = 1.0 * x * y * 4 * (100.0 - nonPaint) / 100;
- String command;
- while (!(command = scanner.nextLine()).equals("Tired!")) {
- neededPaint -= Integer.parseInt(command);
- if (neededPaint <= 0) {
- break;
- }
- }
- if (neededPaint > 0) {
- System.out.println((int) neededPaint + " quadratic m left.");
- } else if (neededPaint == 0) {
- System.out.println("All walls are painted! Great job, Pesho!");
- } else {
- System.out.println("All walls are painted and you have " + (int) Math.abs(neededPaint) + " l paint left!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement