EmoRz

sleep cat Tom

Jun 28th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace sleepingTom
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var dayYear = 365;
  10.             var tomNorm = 30000;
  11.             var freeDay = int.Parse(Console.ReadLine());
  12.             var onWork = 63 *(dayYear-freeDay);
  13.             var onHoliday = 127 * freeDay;
  14.             var allDays = tomNorm-(onHoliday + onWork);
  15.             if (allDays>0)
  16.             {
  17.                 Console.WriteLine("Tom sleeps well");
  18.                 Console.WriteLine($"{allDays/60} hours and {allDays%60} minutes less for play");
  19.             }
  20.             else
  21.             {
  22.                 Console.WriteLine("Tom will run away");
  23.                 Console.WriteLine($"{allDays / 60*-1} hours and {allDays % 60*-1} minutes more for play");
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment