Anzzhhela98

Dance

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