Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _7_Exe___World_Swimming_Record
- {
- class Program
- {
- static void Main(string[] args)
- {
- double worldRecored = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double timeInSeconds = double.Parse(Console.ReadLine());
- double IvanDistance = distance * timeInSeconds;
- double delay = (Math.Floor(distance / 15)) * 12.5;
- double IvanRecord = IvanDistance + delay;
- double diff = Math.Abs(IvanRecord - worldRecored);
- if (IvanRecord >= worldRecored)
- {
- Console.WriteLine($"No, he failed! He was {diff:f2} seconds slower.");
- }
- else
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {diff:f2} seconds.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement