Advertisement
nevenailievaa

08.LunchBreak

Oct 13th, 2022
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace _08.LunchBreak
  5. {
  6.     internal class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             //Input
  11.             string seriesName = (Console.ReadLine());
  12.             int episodeLenght = int.Parse(Console.ReadLine()) ;
  13.             int breakLenght = int.Parse(Console.ReadLine());
  14.  
  15.             //Actions
  16.             double timeForLunch = breakLenght * 0.125;
  17.             double timeForRest = breakLenght * 0.25;
  18.             double timeLeftForWatching = breakLenght - (timeForLunch + timeForRest);
  19.  
  20.             if (timeLeftForWatching >= episodeLenght)
  21.             {
  22.                 Console.WriteLine($"You have enough time to watch {seriesName} and left with {Math.Ceiling(timeLeftForWatching - episodeLenght)} minutes free time.");
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine($"You don't have enough time to watch {seriesName}, you need {Math.Ceiling(episodeLenght - timeLeftForWatching)} more minutes.");
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement