Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DomashnoWorldSwimmingRecord
- {
- class Program
- {
- static void Main(string[] args)
- {
- // get data - WR in seconds, MetersToSwim, SpeedSecondsPerMeter
- double WorldRecordInSecond = double.Parse(Console.ReadLine());
- double MetersToSwim = double.Parse(Console.ReadLine());
- double SpeedSecondsPerMeter = double.Parse(Console.ReadLine());
- // calculate DelayResistanceSeconds
- double DelayResistanceSeconds = (Math.Floor(MetersToSwim / 15)) * 12.5;
- // calculate TimeWithDelay
- double TimeWithDelayInSeconds = SpeedSecondsPerMeter * MetersToSwim + DelayResistanceSeconds;
- // Print Result with Message
- if (TimeWithDelayInSeconds >= WorldRecordInSecond)
- {
- Console.WriteLine($"No, he failed! He was {TimeWithDelayInSeconds - WorldRecordInSecond:F2} seconds slower.");
- }
- else
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {TimeWithDelayInSeconds:F2} seconds.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement