Advertisement
Nikolay_Kashev

Sleepy Tom Cat

Dec 18th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. namespace Sleepy_Tom_Cat
  3. {
  4.     class Program
  5.     {
  6.        public static void Main()
  7.         {
  8.             int DaysOff = int.Parse(Console.ReadLine());
  9.             int limit = 30000;
  10.             int workDays = 365 - DaysOff;
  11.             int playTime = workDays * 63 + DaysOff * 127;
  12.             int mins = Math.Abs(limit - playTime) % 60;
  13.             int hours = Math.Abs(limit - playTime) / 60;
  14.             if (playTime>=limit)
  15.             {
  16.                 Console.WriteLine("Tom will run away");
  17.                 Console.WriteLine("{0} hours and {1} minutes more for play", hours, mins);
  18.             }
  19.             else
  20.             {
  21.                 Console.WriteLine("Tom sleeps well");
  22.                 Console.WriteLine("{0} hours and {1} minutes less for play", hours, mins);
  23.             }          
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement