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 WorldSwimmingRecord
- {
- class Program
- {
- static void Main(string[] args)
- {
- double theRecord = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double timeForOneMeter = double.Parse(Console.ReadLine());
- double timeNeedToSwimm = distance * timeForOneMeter;
- double lateing = (distance / 15) * 12.5;
- double totalTime = timeNeedToSwimm + lateing;
- double diff = Math.Abs(theRecord - totalTime);
- if (totalTime<theRecord)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {totalTime:f2} seconds.");
- }
- else
- {
- Console.WriteLine($"No, he failed! He was {diff:f2} seconds slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement