Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Swimmer
- {
- class Program
- {
- static void Main(string[] args)
- {
- double recordinseconds = double.Parse(Console.ReadLine());
- double distanceinm = double.Parse(Console.ReadLine()); //преобразувах данните в double
- double swimingtime = double.Parse(Console.ReadLine());
- double Ivansrequiredtime = distanceinm * swimingtime;
- double waterreistance = Math.Floor(distanceinm / 15) * 12.5;// при смятането ги закръгляваме надолу..това даде 100/100 в judge
- double Ivanstime = Ivansrequiredtime + waterreistance;
- if (Ivanstime < recordinseconds)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {Ivanstime:F2} seconds.");
- }
- else if (Ivanstime >= recordinseconds)
- {
- Console.WriteLine($"No, he failed! He was {Math.Abs(recordinseconds - Ivanstime):F2} seconds slower.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement