Advertisement
MilenaPetkanova

SinoTheWalker

Oct 30th, 2017
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3.  
  4. class SinoTheWalker
  5. {
  6. static void Main()
  7. {
  8. string leavingTime = Console.ReadLine();
  9. int steps = int.Parse(Console.ReadLine()) % 86400;
  10. int secPerStep = int.Parse(Console.ReadLine()) % 86400;
  11.  
  12. long seconds = steps * secPerStep;
  13.  
  14. DateTime dt = DateTime.ParseExact(leavingTime, "HH:mm:ss", CultureInfo.InvariantCulture);
  15.  
  16. string result = dt.AddSeconds(seconds).ToString("HH:mm:ss");
  17.  
  18. Console.WriteLine("Time Arrival: {0}", result);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement