daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace world_record_swimming
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double record = double.Parse(Console.ReadLine());
  10.             double meters = double.Parse(Console.ReadLine());
  11.             double onemetersswim = double.Parse(Console.ReadLine());
  12.             double ivanchotime = meters * onemetersswim;
  13.             double addedtime = Math.Round(meters / 15)*12.5;
  14.             double totaltime = ivanchotime + addedtime;
  15.             if (record<totaltime)
  16.             {
  17.                 double timeneeded = totaltime - record;
  18.                 Console.WriteLine($"No, he failed! He was {timeneeded:F2} seconds slower.");
  19.             }
  20.             else
  21.             {
  22.  
  23.                 Console.WriteLine($"Yes, he succeeded! The new world record is {totaltime:F2} seconds.");
  24.             }
  25.         }
  26.     }
  27. }
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