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