Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Java1program;
- import java.util.Scanner;
- public class dwe_pet {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int neededHours = Integer.parseInt(scanner.nextLine());
- int days = Integer.parseInt(scanner.nextLine());
- int workers = Integer.parseInt(scanner.nextLine());
- double workDays = (days * 0.9) * 8;
- double workHours = (workers * (2 * days));
- double hours = workHours + workDays;
- double dif = hours - neededHours;
- double hoursDif = Math.floor(hours - neededHours) * (-1);
- if (hours >= neededHours) {
- System.out.printf("Yes !%.0f hours left.", dif);
- } else {
- System.out.printf("Not enough time!%.0f hours needed.", hoursDif);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement