Anzzhhela98

222

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