Advertisement
Sim0o0na

1. Travel

Mar 12th, 2018
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 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 _01
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double S = double.Parse(Console.ReadLine());
  14.             double V= double.Parse(Console.ReadLine());
  15.             double Y= double.Parse(Console.ReadLine());
  16.  
  17.             double vCar = V + 3.6 * Y;
  18.  
  19.             double timeTruck = S / V;
  20.             double timeCar = S / vCar;
  21.  
  22.             Console.WriteLine("The truck arrived after {0} hours",Math.Ceiling(timeTruck));
  23.             Console.WriteLine("The car arrived after {0} hours",Math.Ceiling(timeCar));
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement