Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace WorldSwimmingRecord
- {
- class Program
- {
- static void Main(string[] args)
- {
- double recordTime = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double meterSwimsPerSec = double.Parse(Console.ReadLine());
- double newTime = distance * meterSwimsPerSec;
- double slowing = Math.Floor(distance / 15 * 12.5);
- Console.WriteLine($"slowing is: {slowing}");
- newTime += slowing;
- bool isGreater = newTime < recordTime;
- if (isGreater)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {newTime:f2} seconds.");
- }
- else
- {
- Console.WriteLine($"No, he failed! He was {(newTime - recordTime):f2} seconds slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement