Advertisement
IvanBorisovG

SleepyCatTom

Aug 17th, 2017
82
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.             int workingDays = 365 - numberOfRestDays;
  3.             int TotalPlayingTimeInMinutes = (workingDays * 63) + (numberOfRestDays * 127);
  4.             int restPlayingTime = 30000 - TotalPlayingTimeInMinutes;
  5.             int restPlayingTimeHours = Math.Abs(restPlayingTime / 60);
  6.             int restPlayingTimeMinutes = Math.Abs(restPlayingTime % 60);
  7.             if (TotalPlayingTimeInMinutes <= 30000)
  8.             {
  9.                 Console.WriteLine("Tom sleeps well");
  10.                 Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes less for play");
  11.  
  12.             }
  13.             else
  14.             {              
  15.                 Console.WriteLine("Tom will run away");
  16.                 Console.WriteLine($"{restPlayingTimeHours} hours and {restPlayingTimeMinutes} minutes more for play");
  17.  
  18.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement