Pretorianbg

Untitled

Sep 23rd, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 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 World_Swimming_record
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double record = double.Parse(Console.ReadLine());
  14. double distance = double.Parse(Console.ReadLine());
  15. double speed = double.Parse(Console.ReadLine());
  16.  
  17. double time = distance * speed;
  18. double slowdown = Math.Floor(distance/15)*12.5;
  19. double finaltime = time + slowdown;
  20. double timeneeded = finaltime - record;
  21.  
  22. if (record<=finaltime)
  23. {
  24. Console.WriteLine($"No, he failed! He was {timeneeded:F2} seconds slower.");
  25. }
  26. else
  27. {
  28. Console.WriteLine($" Yes, he succeeded! The new world record is {finaltime:F2} seconds.");
  29. }
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment