Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2020
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import java.math.BigDecimal;
  2. import java.util.*;
  3.  
  4. public class Test27 {
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         int breakDays = Integer.parseInt(scanner.nextLine());
  9.         int norma = 30000;
  10.         int workDays = 365 - breakDays;
  11.         int timeIgra = workDays * 63 + breakDays * 127;
  12.         int mins = Math.abs(norma - timeIgra) % 60;
  13.         int hours = Math.abs(norma - timeIgra) / 60;
  14.         if (timeIgra >= norma) {
  15.             System.out.println("Tom will run away");
  16.             System.out.printf("%s hours and %s minutes more for play", hours, mins);
  17.  
  18.         } else {
  19.             System.out.println("Tom sleeps well");
  20.             System.out.printf("%s hours and %s minutes less for play", hours, mins);
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement