Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConditionalStatements
- {
- class Program
- {
- static void Main()
- {
- double recordInSec = double.Parse(Console.ReadLine());
- double distanceInMeters = double.Parse(Console.ReadLine());
- double timeInSecPerMeter = double.Parse(Console.ReadLine());
- double timeForDistance = distanceInMeters * timeInSecPerMeter;
- double timesDelayed = Math.Floor(distanceInMeters / 15);
- double delayTime = timesDelayed * 12.5;
- double totalTime = timeForDistance + delayTime;
- if(totalTime < recordInSec)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {totalTime:f2} seconds.");
- }
- else
- {
- double timeSlowerInSec = totalTime - recordInSec;
- Console.WriteLine($"No, he failed! He was {timeSlowerInSec:f2} seconds slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement