Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MountainRun
- {
- public class
- {
- public static void Main(string[] args)
- {
- double worldRecord = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double timePerMeter = double.Parse(Console.ReadLine());
- double timeInSeconds = distance * timePerMeter;
- double additionalSeconds = Math.Floor(distance / 50) * 30;
- double totalTime = timeInSeconds + additionalSeconds;
- if (totalTime < worldRecord)
- {
- Console.WriteLine($"Yes! The new record is {totalTime:F2} seconds.");
- }
- else
- {
- Console.WriteLine($"No! He was {Math.Abs(worldRecord - totalTime):F2} seconds slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement