Advertisement
Valantina

Skeleton/EX

Jun 13th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 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 controlMinutes = int.Parse(Console.ReadLine());
  10.             int controlSeconds = int.Parse(Console.ReadLine());
  11.             double lenght = double.Parse(Console.ReadLine());
  12.             int OneHundredMeter = int.Parse(Console.ReadLine());
  13.             int totalSeconds = controlMinutes * 60 + controlSeconds;
  14.             double loseLenght = lenght / 120;
  15.             double totalLoseLenght = loseLenght * 2.5;
  16.  
  17.             double totalTime = (lenght / 100) * OneHundredMeter - totalLoseLenght;
  18.             if (totalTime <= totalSeconds)
  19.             {
  20.                 Console.WriteLine("Marin Bangiev won an Olympic quota!");
  21.                 Console.WriteLine($"His time is {totalTime:f3}.");
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine($"No, Marin failed! He was {Math.Abs(totalTime - totalSeconds):f3} second slower.");
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement