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