Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace trytodothebest
- {
- class Program
- {
- static void Main(string[] args)
- {
- var record = double.Parse(Console.ReadLine());
- var distance = double.Parse(Console.ReadLine());
- var timeToSec = double.Parse(Console.ReadLine());
- var swims = distance * timeToSec;
- var timewith15secs = Math.Floor(distance / 15) * 12.5;
- var allTime = (swims + timewith15secs);
- if (record < allTime)
- {
- Console.WriteLine($"No, he failed! He was {allTime - record:f2} seconds slower.");
- }
- else if (record > allTime)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {allTime:f2} seconds.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement