Advertisement
Teko96

Untitled

Oct 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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 Световен_рекорд_по_плуване
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var recordInSec = double.Parse(Console.ReadLine());
  14. var lengthInMetres = double.Parse(Console.ReadLine());
  15. var timeInSec = double.Parse(Console.ReadLine());
  16.  
  17. var allLength = lengthInMetres * timeInSec;
  18. var delay = Math.Floor((lengthInMetres / 15) * 12.5);
  19. var allTime = allLength + delay;
  20. var difference = allTime - recordInSec;
  21.  
  22. if (difference >= 0)
  23. {
  24. Console.WriteLine("No, he failed! He was {0:F2} seconds slower.", difference);
  25. }
  26. else
  27. {
  28. Console.WriteLine("Yes, he succeeded! The new world record is {0:F2} seconds.", allTime);
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement