Spocoman

08. Lunch Break

Nov 16th, 2021 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. namespace LunchBreak
  3. {
  4.     class Program
  5.     {
  6.         static void Main()
  7.         {
  8.             string serialName = Console.ReadLine();
  9.             int serialTime = int.Parse(Console.ReadLine());
  10.             int breakTime = int.Parse(Console.ReadLine());
  11.  
  12.             double neededTime = breakTime / 8.0 + breakTime / 4.0 + serialTime;
  13.  
  14.             if (neededTime <= breakTime)
  15.             {
  16.                 Console.WriteLine($"You have enough time to watch {serialName} " +
  17.                     $"and left with {breakTime - Math.Floor(neededTime)} minutes free time.");
  18.             }
  19.             else
  20.             {
  21.                 Console.WriteLine($"You don't have enough time to watch {serialName}," +
  22.                     $" you need {Math.Ceiling(neededTime) - breakTime} more minutes.");
  23.             }
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment