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 worldSwimmingRecord
- {
- static void Main(string[] args)
- {
- double record = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double secsPerMeter = double.Parse(Console.ReadLine());
- var time = distance * secsPerMeter;
- var waterDrag = Math.Floor(distance / 15) * 12.5;
- var allTime = time+waterDrag;
- if (allTime<record)
- {
- Console.WriteLine(" Yes, he succeeded! The new world record is {0:f2} seconds.",allTime);
- }
- else
- {
- Console.WriteLine("No, he failed! He was {0:f2} seconds slower.",allTime-record);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement