Advertisement
IvanBorisovG

SleepyCatTom

Aug 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. int numberOfRestDays = int.Parse(Console.ReadLine());
  2.            
  3.             int workingDays = 365 - numberOfRestDays;
  4.             int TotalPlayingTimeInMinutes = (workingDays * 63) + (numberOfRestDays * 127);
  5.             int restPlayingTime = 30000 - TotalPlayingTimeInMinutes;
  6.  
  7.             int restPlayingTimeHours = Math.Abs(restPlayingTime / 60);
  8.             int restPlayingTimeMinutes = Math.Abs(restPlayingTime % 60);
  9.  
  10.             if (TotalPlayingTimeInMinutes <= 30000)
  11.             {
  12.                 Console.WriteLine("Tom sleeps well");
  13.                 Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes less for play");
  14.  
  15.             }
  16.             else
  17.             {              
  18.                 Console.WriteLine("Tom will run away");
  19.                 Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes more for play");
  20.  
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement