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 recordSec = double.Parse(Console.ReadLine());
- double distanceMeters = double.Parse(Console.ReadLine());
- double secondsOneMeter = double.Parse(Console.ReadLine());
- double speedFinal = (secondsOneMeter*distanceMeters) + (Math.Floor(distanceMeters/ 15) * 12.5);
- if (recordSec > speedFinal)
- {
- Console.WriteLine($"Yes, he succeeded! The new world record is {speedFinal} seconds.");
- }
- else
- {
- double lostBy = speedFinal - recordSec;
- Console.WriteLine("No, he failed! He was {0:f2} seconds slower.", lostBy);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement