Anzzhhela98

ff

Jun 17th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loopsk
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double record = double.Parse(Console.ReadLine());
  10.             double length = double.Parse(Console.ReadLine());
  11.            double timePerOneMeeter = double.Parse(Console.ReadLine());
  12.  
  13.             double swimingTime = length * timePerOneMeeter;
  14.             double stopMeeter =swimingTime + Math.Floor(length / 15)*12.5;
  15.            
  16.  
  17.             if (record>stopMeeter)
  18.             {
  19.                 Console.WriteLine($"Yes, he succeeded! The new world record is {stopMeeter:f2} seconds.");
  20.  
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine($"No, he failed! He was {stopMeeter-record:f2} seconds slower.");
  25.             }
  26.  
  27.            
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment