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