Advertisement
VickSuna

Untitled

Dec 11th, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam_Problem_2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double recordInSeconds = double.Parse(Console.ReadLine());
  10. double distanceInMeters = double.Parse(Console.ReadLine());
  11. double metersInSecond = double.Parse(Console.ReadLine());
  12.  
  13. double time = (distanceInMeters * metersInSecond) + (Math.Floor(distanceInMeters / 50) * 30);
  14.  
  15. if (recordInSeconds <= time)
  16. {
  17. Console.WriteLine($"No! He was {time - recordInSeconds:F2} seconds slower.");
  18. }
  19. else
  20. {
  21. Console.WriteLine($"Yes! The new record is {time:F2} seconds.");
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement