Advertisement
Valantina

LunchBreak

Jun 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02.LunchBreak
  4. {
  5.     class P02_LunchBreak
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string name = Console.ReadLine();
  10.             int episodeTime = int.Parse(Console.ReadLine());
  11.             int breakTime = int.Parse(Console.ReadLine());
  12.  
  13.             double lunchTime = breakTime / 8.0;
  14.             double restTime = breakTime / 4.0;
  15.             double leftTime = breakTime - (lunchTime + restTime);
  16.  
  17.             if(leftTime >= episodeTime)
  18.             {
  19.                 Console.WriteLine($"You have enough time to watch {name} and left with {Math.Ceiling(leftTime - episodeTime)} minutes free time.");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"You don't have enough time to watch {name}, you need {Math.Ceiling(episodeTime - leftTime)} more minutes.");
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement