Advertisement
IvanBorisovG

SleepyCatTom

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