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