Advertisement
skipter

01.Shino The Walker

Oct 1st, 2017
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. namespace _01.SinoTheWalker
  2. {
  3.     using System;
  4.     using System.Globalization;
  5.     public class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             // 86400 seconds in 1 day
  10.             CultureInfo provider = CultureInfo.InvariantCulture;
  11.             DateTime shinoLeaveTheBuilding = DateTime.ParseExact(Console.ReadLine(), "HH:mm:ss", provider);
  12.             double steps = double.Parse(Console.ReadLine());
  13.             double secondsForStep = double.Parse(Console.ReadLine());
  14.  
  15.             steps = steps % 86400;
  16.             secondsForStep = secondsForStep % 86400;
  17.  
  18.             double howLongIsHeWalk = steps * secondsForStep;
  19.             DateTime dtm = shinoLeaveTheBuilding.AddSeconds(howLongIsHeWalk);
  20.             string answer = string.Format("Time Arrival: {0}", dtm.ToString("HH:mm:ss"));
  21.             Console.WriteLine(answer);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement