grach

2016_April_24 Cat Tom Sleepy

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