Advertisement
obedmarsh

01. Sino The Walker

Sep 3rd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Media;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7.  
  8. class Program
  9. {
  10.     public static void Main(string[] args)
  11.     {
  12.         string input = Console.ReadLine();
  13.             int stepsCount = int.Parse(Console.ReadLine()) % 86400;
  14.             int secondsPerStep = int.Parse(Console.ReadLine()) % 86400;
  15.             DateTime d = DateTime.Parse(input);
  16.             TimeSpan duration = TimeSpan.FromSeconds(secondsPerStep * stepsCount);
  17.             TimeSpan ts = d.TimeOfDay.Add(duration);
  18.             Console.WriteLine("Time Arrival: {0:D2}:{1:D2}:{2:D2}", ts.Hours, ts.Minutes, ts.Seconds);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement