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 World_Swimming_Record
- {
- class Program
- {
- static void Main(string[] args)
- {
- double recordSec = double.Parse(Console.ReadLine());
- int distance = int.Parse(Console.ReadLine());
- double timeSecForOneMeter = double.Parse(Console.ReadLine());
- double swimingNeed = distance * timeSecForOneMeter;
- double addSec = (distance / 15) * 12.5;
- double sumTime = swimingNeed + addSec;
- if (recordSec<=sumTime)
- {
- Console.WriteLine($"No, he failed! He was {sumTime-recordSec:F2} seconds slower.");
- }
- else if (recordSec>sumTime)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {sumTime:F2} seconds.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement