Advertisement
viraco4a

Untitled

Mar 12th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Travel
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. double distance = double.Parse(Console.ReadLine());
  10. double velocityTruck = double.Parse(Console.ReadLine());
  11. double diffVel = (3.6) * double.Parse(Console.ReadLine());
  12. double velocityCar = diffVel + velocityTruck;
  13. double timeTruck = Math.Ceiling(distance / velocityTruck);
  14. double timeCar = Math.Ceiling(distance / velocityCar);
  15. Console.WriteLine($"The truck arrived after {timeTruck} hours");
  16. Console.WriteLine($"The car arrived after {timeCar} hours");
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement