Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _11ConvertSpeedUnits
- {
- class Program
- {
- static void Main(string[] args)
- {
- int dist = int.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double m = double.Parse(Console.ReadLine());
- double s = double.Parse(Console.ReadLine());
- double time = h*3600+m*60.0+s;
- double MInSecond = dist / time;
- double KmInHour = (dist/1000.0)/(time/3600);
- double MilesInHour = (dist/1609.0)/(time/3600);
- Console.WriteLine($"{MInSecond:0.#######}\n{KmInHour:0.#######}\n{MilesInHour:0.#######}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement