Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double record = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double secsperm = double.Parse(Console.ReadLine());
- if (record >= 0 && distance >= 0 && secsperm >= 0)
- {
- double allsecs = distance * secsperm;
- double timesslowed = Math.Round(distance / 15);
- double secsfinal = allsecs + (timesslowed * 12.5);
- if (secsfinal < record)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {secsfinal:F2} seconds.");
- }
- else if (secsfinal >= record)
- {
- double secsslower = secsfinal - record;
- Console.WriteLine($"No, he failed! He was {secsslower:F2} seconds slower.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement