Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Travel
- {
- class Program
- {
- static void Main()
- {
- double distance = double.Parse(Console.ReadLine());
- double velocityTruck = double.Parse(Console.ReadLine());
- double diffVel = (3.6) * double.Parse(Console.ReadLine());
- double velocityCar = diffVel + velocityTruck;
- double timeTruck = Math.Ceiling(distance / velocityTruck);
- double timeCar = Math.Ceiling(distance / velocityCar);
- Console.WriteLine($"The truck arrived after {timeTruck} hours");
- Console.WriteLine($"The car arrived after {timeCar} hours");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement