nicolepavlova386

tom

Oct 22nd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 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 tupa_kotka
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int holidays = int.Parse(Console.ReadLine());
  14.             int workDays = 365 - holidays;
  15.             int totalGameTime = (holidays * 127) + (workDays * 63);
  16.  
  17.             if (30000 < totalGameTime)
  18.             {
  19.                 Console.WriteLine("Tom will run away");
  20.                 var hours = Math.Abs((30000 - totalGameTime) / 60);
  21.                 var minutes = Math.Abs((30000 - totalGameTime) % 60);
  22.                 Console.WriteLine("{0} hours and {1} minutes more for play", hours, minutes);
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine("Tom sleeps well");
  27.                 var hours = Math.Abs((totalGameTime - 30000) / 60);
  28.                 var minutes = Math.Abs((totalGameTime - 30000) % 60);
  29.                 Console.WriteLine("{0} hours and {1} minutes less for play", hours, minutes);
  30.             }
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment