Advertisement
silvana1303

skeleton

Apr 25th, 2020
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int ctrMinutes = int.Parse(Console.ReadLine());
  10.             int ctrSeconds = int.Parse(Console.ReadLine());
  11.             double lenght = double.Parse(Console.ReadLine());
  12.             int secondsInMetres = int.Parse(Console.ReadLine());
  13.  
  14.             int timeInSeconds = ctrMinutes * 60 + ctrSeconds;
  15.             double timeSlowed = (lenght / 120) * 2.5;
  16.             double timeMarin = (lenght / 100.0) * secondsInMetres - timeSlowed;
  17.  
  18.             if (timeMarin <= timeInSeconds)
  19.             {
  20.                 Console.WriteLine("Marin Bangiev won an Olympic quota!");
  21.                 Console.WriteLine($"His time is {timeMarin:f3}.");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine($"No, Marin failed! He was {timeMarin - timeInSeconds:f3} second slower.");
  26.             }
  27.  
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement