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 holidaysDays = Integer.parseInt(scanner.nextLine());
- int workingDays = 365 - holidaysDays;
- int totalPlayMinutes = workingDays * 63 + holidaysDays * 127;
- int norma = 30000;
- int diff = Math.abs(norma - totalPlayMinutes);
- int hours = diff / 60;
- int minutes = diff % 60;
- if (totalPlayMinutes >= 30000) {
- System.out.println("Tom will run away");
- System.out.printf("%d hours and %d minutes more for play", hours, minutes);
- } else {
- System.out.println("Tom sleeps well");
- System.out.printf("%d hours and %d minutes less for play", hours, minutes);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement