Advertisement
silvana1303

sleepy tom cat

Mar 24th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 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. namespace silvanadoc
  7. {
  8.     class silvanadoc
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int daysOff = int.Parse(Console.ReadLine());
  13.  
  14.             int workDays = 365 - daysOff;
  15.  
  16.             int playMinutesWork = workDays * 63;
  17.             int playMinutesOff = daysOff * 127;
  18.             int fullTimePlaying = playMinutesWork + playMinutesOff;
  19.             int restMinutes = (30000 - fullTimePlaying);
  20.             int hours = Math.Abs(restMinutes) / 60;
  21.             int minutes = Math.Abs(restMinutes) % 60;
  22.            
  23.  
  24.             if (fullTimePlaying > 30000)
  25.             {
  26.                
  27.                 Console.WriteLine("Tom will run away");
  28.                 Console.WriteLine($"{hours} hours and {minutes} minutes more for play");
  29.             }
  30.             else if (fullTimePlaying <= 30000)
  31.             {
  32.              
  33.                 Console.WriteLine("Tom sleeps well");
  34.                 Console.WriteLine($"{hours} hours and {minutes} minutes less for play");
  35.             }
  36.  
  37.            
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement