LardaX

Sleepy-Tom

Jul 5th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Sleepy_Tom
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int nonWorkingDays = int.Parse(Console.ReadLine());
  14.  
  15.             int workingDays = 365 - nonWorkingDays;
  16.             int totalPlayTime = workingDays * 63 + nonWorkingDays * 127;
  17.  
  18.             int gapBetweenRestAndPlay = Math.Abs(30000 - totalPlayTime);
  19.             int hoursGap = gapBetweenRestAndPlay / 60;
  20.             int minutesGap = gapBetweenRestAndPlay % 60;
  21.  
  22.          
  23.             if (totalPlayTime > 30000)
  24.             {
  25.                 Console.WriteLine("Tom will run away");
  26.                 Console.WriteLine("{0} hours and {1} minutes more for play", hoursGap, minutesGap);
  27.             }
  28.             else
  29.             {
  30.                 Console.WriteLine("Tom sleeps well");
  31.                 Console.WriteLine("{0} hours and {1} minutes less for play", hoursGap, minutesGap);
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment