SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace World_Swimming_Record
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double recordSec = double.Parse(Console.ReadLine());
  10.  
  11.             double distanceMeter = double.Parse(Console.ReadLine());
  12.  
  13.             double timeSec = double.Parse(Console.ReadLine());
  14.  
  15.             double finalTimeSec = distanceMeter * timeSec;
  16.  
  17.             double resistanceWater = (Math.Floor (distanceMeter / 15) * 12.5);
  18.  
  19.             double totalTime = finalTimeSec + resistanceWater;
  20.            
  21.  
  22.             if (recordSec < totalTime)
  23.  
  24.  
  25.             {
  26.                 double restTime = totalTime - recordSec;
  27.                 Console.WriteLine($"No, he failed! He was {restTime:f2} seconds slower.");
  28.  
  29.             }
  30.  
  31.            
  32.  
  33.              else if (recordSec > totalTime)
  34.                
  35.             {
  36.                
  37.                 Console.WriteLine($"Yes, he succeeded! The new world record is {totalTime:f2} seconds.");
  38.  
  39.             }
  40.         }
  41.     }
  42. }
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