Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Extra;
- import java.util.Scanner;
- public class P02SleepyTomCat {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int daysOff = Integer.parseInt(scanner.nextLine());
- int daysOffInMinutes = daysOff * 127;
- int workDaysInMinutes = (365 - daysOff) * 63;
- int minMore = Math.abs(30000 - (daysOffInMinutes + workDaysInMinutes));
- int hours = minMore / 60;
- int minutes = minMore % 60;
- if (daysOffInMinutes + workDaysInMinutes > 30000) {
- System.out.printf("Tom will run away%n%d hours and %02d minutes more for play", hours, minutes);
- }else {
- System.out.printf("Tom sleeps well%n%d hours and %02d minutes less for play",hours,minutes);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement