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