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