Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace pluvane
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var record = double.Parse(Console.ReadLine());
  14.             var metri = double.Parse(Console.ReadLine());
  15.             var vreme = double.Parse(Console.ReadLine());
  16.             double razstoqnie = metri * vreme;
  17.             double dobavka = Math.Floor(metri/15)*12.5;
  18.             double totaltime = razstoqnie + dobavka;
  19.             if (record<=totaltime)
  20.             {
  21.                 double nedostig = totaltime - record;
  22.                 Console.WriteLine($"No, he failed! He was {nedostig:f2} seconds slower.");
  23.             }
  24.             else
  25.             {
  26.                                
  27.                 Console.WriteLine($"Yes, he succeeded! The new world record is {totaltime:f2} seconds.");
  28.             }
  29.            
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement