Advertisement
Guest User

SleepyCat

a guest
Dec 7th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.89 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 SleepyTomCat
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //брой почивни дни
  14.             int relaxDays = int.Parse(Console.ReadLine());
  15.             int yearDays = 365;
  16.             int restDays = yearDays - relaxDays;
  17.             int MinutesForPlay = relaxDays * 127 + restDays * 63;
  18.            
  19.             int MinutesPlayingForAYear = 30000;
  20.             int HoursPlayingForAYear = MinutesPlayingForAYear / 60;
  21.            
  22.             int hoursForPlay = 0;
  23.  
  24.             //• Когато е на работа, стопанинът му си играе с него по 63 минути на ден.
  25.             //• Когато почива, стопанинът му си играе с него по 127 минути на ден.
  26.  
  27.             for (MinutesForPlay = 0; MinutesForPlay <= 59; MinutesForPlay++)
  28.             {
  29.                 hoursForPlay++;
  30.             }
  31.            
  32.  
  33.             if(MinutesForPlay > 30000)
  34.             {
  35.                 int DifferentHoursMinus = hoursForPlay - HoursPlayingForAYear;
  36.                 int DifferentMinutesMinus = MinutesForPlay - MinutesPlayingForAYear;
  37.                 Console.WriteLine("Tom will run away!");
  38.                 Console.WriteLine($"{DifferentHoursMinus} hours and {DifferentMinutesMinus} minutes more for play");
  39.                
  40.             }
  41.             else
  42.             {
  43.                 int DifferentHoursPlus = HoursPlayingForAYear - hoursForPlay;
  44.                 int DifferentMinutesPlus = MinutesPlayingForAYear - MinutesForPlay;
  45.                 Console.WriteLine("Tom sleeps well");
  46.                 Console.WriteLine($"{DifferentHoursPlus} hours and {DifferentMinutesPlus} minutes less for play");
  47.             }
  48.  
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement