Advertisement
sanyakasarova

02. Movie Day

Dec 11th, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3.  
  4. class Program
  5. {
  6. static void Main()
  7. {
  8. int goalShootingTime = int.Parse(Console.ReadLine());
  9. int numOfShots = int.Parse(Console.ReadLine());
  10. int timeForOneShot = int.Parse(Console.ReadLine());
  11.  
  12. double preparation = goalShootingTime * 0.15;
  13. double totalTimeForShooting = numOfShots * timeForOneShot;
  14.  
  15. double totalTime = preparation + totalTimeForShooting;
  16.  
  17. double difference = Math.Abs(goalShootingTime - totalTime);
  18.  
  19. if (goalShootingTime >= totalTime)
  20. {
  21. Console.WriteLine($"You managed to finish the movie on time! You have {Math.Round(difference)} minutes left!");
  22. }
  23. else
  24. {
  25. Console.WriteLine($"Time is up! To complete the movie you need {difference} minutes.");
  26. }
  27.  
  28. }
  29.  
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement