Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package IzpitZadachi.b_Second;
- import java.util.Scanner;
- public class ThreeBrothers {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- Double a = Double.parseDouble(scan.nextLine());
- Double b = Double.parseDouble(scan.nextLine());
- Double c = Double.parseDouble(scan.nextLine());
- Double d = Double.parseDouble(scan.nextLine());
- Double cleaningtime = 1 / (1 / a + 1 / b + 1 / c);
- cleaningtime = cleaningtime + (cleaningtime * 0.15);
- System.out.printf("Cleaning time: %.2f%n", cleaningtime);
- if (cleaningtime < d) {
- System.out.printf("Yes, there is a surprise - time left -> %.0f hours.",
- Math.floor(d - cleaningtime));
- } else {
- System.out.printf("No, there isn't a surprise - shortage of time -> %.0f hours.",
- Math.ceil(cleaningtime - d));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement