Advertisement
Guest User

sino

a guest
Feb 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 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 SinoTheWalker_6_Jan_2017
  8. {
  9. class SinoTheWalker
  10. {
  11. static void Main(string[] args)
  12. {
  13. var timeOfleaving = Console.ReadLine().Split(':');
  14. var numberOfSteps = int.Parse(Console.ReadLine());
  15. var secondsForStep = int.Parse(Console.ReadLine());
  16.  
  17. var sum = numberOfSteps * secondsForStep;
  18.  
  19. var timeOfLeavingParsed = new TimeSpan(int.Parse(timeOfleaving[0]), int.Parse(timeOfleaving[1]), int.Parse(timeOfleaving[2]));
  20.  
  21. var time = TimeSpan.FromSeconds(timeOfLeavingParsed.TotalSeconds);
  22. var secons = TimeSpan.FromSeconds(sum);
  23. var arrivalTime = time.Add(secons);
  24.  
  25. var arrivalTimeFormated = string.Format($"{arrivalTime.Hours:d2}:{arrivalTime.Minutes:d2}:{arrivalTime.Seconds:d2}");
  26.  
  27. Console.WriteLine($"Time Arrival: {arrivalTimeFormated}");
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement