Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Loops
- {
- class Program
- {
- static void Main(string[] args)
- {
- int ctrMinutes = int.Parse(Console.ReadLine());
- int ctrSeconds = int.Parse(Console.ReadLine());
- double lenght = double.Parse(Console.ReadLine());
- int secondsInMetres = int.Parse(Console.ReadLine());
- int timeInSeconds = ctrMinutes * 60 + ctrSeconds;
- double timeSlowed = (lenght / 120) * 2.5;
- double timeMarin = (lenght / 100.0) * secondsInMetres - timeSlowed;
- if (timeMarin <= timeInSeconds)
- {
- Console.WriteLine("Marin Bangiev won an Olympic quota!");
- Console.WriteLine($"His time is {timeMarin:f3}.");
- }
- else
- {
- Console.WriteLine($"No, Marin failed! He was {timeMarin - timeInSeconds:f3} second slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement