Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08.LunchBreak
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string nameOfFilm = Console.ReadLine();
- int timeOfFilm = int.Parse(Console.ReadLine());
- int lunchBreak = int.Parse(Console.ReadLine());
- double timeForObqd = lunchBreak * 0.125;
- double timeForPochivka = lunchBreak * 0.25;
- double allNededTime = timeOfFilm + timeForObqd + timeForPochivka;
- double difference = Math.Abs(lunchBreak - allNededTime);
- if (lunchBreak - allNededTime >= 0)
- {
- Console.WriteLine($"You have enough time to watch {nameOfFilm} and left with {Math.Ceiling(difference)} minutes free time.");
- }
- else
- {
- Console.WriteLine($"You don't have enough time to watch {nameOfFilm}, you need {Math.Ceiling(difference)} more minutes.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement