Advertisement
Guest User

Untitled

a guest
May 22nd, 2016
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. uint meters = UInt32.Parse(Console.ReadLine());
  8. byte hours = byte.Parse(Console.ReadLine());
  9. byte minutes = byte.Parse(Console.ReadLine());
  10. byte seconds = byte.Parse(Console.ReadLine());
  11.  
  12. ushort time = (ushort)(hours * 3600 + minutes * 60 + seconds);
  13.  
  14. float metersPerSec = (float)meters / time;
  15. float kilometersPerHour = ((float)meters / 1000) / ((float)time / 3600);
  16. float milesPerHour = ((float)meters / 1609) / ((float)time / 3600);
  17.  
  18. Console.WriteLine("{0:0.#######}", metersPerSec);
  19. Console.WriteLine("{0:0.#######}", kilometersPerHour);
  20. Console.WriteLine("{0:0.#######}", milesPerHour);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement