Advertisement
nvnnaidenov

SleepyTomCat - Chapter 3.1

Feb 11th, 2022
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. //Task 003, Chapter 3.1
  2. using System;
  3.  
  4. public class SleepyTomCat
  5. {
  6.     static void Main()
  7.     {
  8.         int days = int.Parse(Console.ReadLine());
  9.  
  10.         int workingDays = 365 - days;
  11.         int totalPlayMinutes = workingDays * 63 + days * 127;
  12.         int diff = Math.Abs(totalPlayMinutes - 30000);
  13.         int hours = diff / 60;
  14.         int minutes = diff % 60;
  15.  
  16.         if (totalPlayMinutes > 30000)
  17.         {
  18.             Console.WriteLine("Tom will run away");
  19.             Console.WriteLine($"{hours} hours and {minutes} minutes more for play");
  20.         }
  21.         else
  22.         {
  23.             Console.WriteLine("Tom sleeps well");
  24.             Console.WriteLine($"{hours} hours and {minutes} minutes less for play");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement