SHARE
TWEET

Untitled

a guest Nov 22nd, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Осма_задача___Световен_рекорд_по_плуване
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double recordTimeInSeconds = double.Parse(Console.ReadLine());
  10.             double distanceInMetres = double.Parse(Console.ReadLine());
  11.             double timeInSecondsFor1MetreSwimming = double.Parse(Console.ReadLine());
  12.  
  13.             double swimmingTime = distanceInMetres * timeInSecondsFor1MetreSwimming;
  14.             double resistenceTime = Math.Floor(distanceInMetres / 15) * 12.5;
  15.              swimmingTime += resistenceTime;
  16.  
  17.             if (recordTimeInSeconds > swimmingTime)
  18.             {
  19.                 Console.WriteLine($"Yes, he succeeded! The new world record is {swimmingTime:f2} seconds.");
  20.             }
  21.             else
  22.             {
  23.                 double difference = swimmingTime - recordTimeInSeconds;
  24.                 Console.WriteLine($"No, he failed! He was {difference:f2} seconds slower.");
  25.             }
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top