Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 _11ConvertSpeedUnits
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int dist = int.Parse(Console.ReadLine());
  14. double h = double.Parse(Console.ReadLine());
  15. double m = double.Parse(Console.ReadLine());
  16. double s = double.Parse(Console.ReadLine());
  17.  
  18. double time = h*3600+m*60.0+s;
  19.  
  20. double MInSecond = dist / time;
  21. double KmInHour = (dist/1000.0)/(time/3600);
  22. double MilesInHour = (dist/1609.0)/(time/3600);
  23.  
  24.  
  25.  
  26.  
  27. Console.WriteLine($"{MInSecond:0.#######}\n{KmInHour:0.#######}\n{MilesInHour:0.#######}");
  28.  
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement