Advertisement
Spocoman

Skeleton

Nov 28th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Skeleton
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int minutes = int.Parse(Console.ReadLine());
  10.             int seconds = int.Parse(Console.ReadLine());
  11.             double lengthInMeters = double.Parse(Console.ReadLine());
  12.             double secondsFor100Meters = double.Parse(Console.ReadLine());
  13.             int control = minutes * 60 + seconds;
  14.             double time = lengthInMeters / 100 * secondsFor100Meters - lengthInMeters / 120 * 2.5;
  15.  
  16.             if (time <= control)
  17.             {
  18.                 Console.WriteLine($"Marin Bangiev won an Olympic quota!\nHis time is { time:f3}.");
  19.             }
  20.             else
  21.             {
  22.                 Console.WriteLine($"No, Marin failed! He was { time - control:f3} second slower.");
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement