daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2018 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace worldSwimmingRecord
  8. {
  9.     class worldSwimmingRecord
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double record = double.Parse(Console.ReadLine());
  14.             double distance = double.Parse(Console.ReadLine());  
  15.             double secsPerMeter = double.Parse(Console.ReadLine());
  16.  
  17.             var time = distance * secsPerMeter;
  18.             var waterDrag = Math.Floor(distance / 15) * 12.5;
  19.             var allTime = time+waterDrag;
  20.  
  21.             if (allTime<record)
  22.             {
  23.                 Console.WriteLine(" Yes, he succeeded! The new world record is {0:f2} seconds.",allTime);
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("No, he failed! He was {0:f2} seconds slower.",allTime-record);
  28.             }
  29.          
  30.         }
  31.     }
  32. }
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