Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Sino_the_Walker
- {
- class Program
- {
- static void Main(string[] args)
- {
- long[] startTime = Console.ReadLine().Split(':').Select(long.Parse).ToArray();
- long hours = startTime[0];
- long minutes = startTime[1];
- long seconds = startTime[2];
- long steps = long.Parse(Console.ReadLine());
- int secondsPerStep = int.Parse(Console.ReadLine());
- long totalSecondsToWalk = steps * secondsPerStep;
- seconds += totalSecondsToWalk;
- hours += (long)(Math.Floor((double)(seconds / 3600)));
- seconds = seconds % 3600;
- minutes += (long)(Math.Floor((double)(seconds / 60)));
- seconds = seconds % 60;
- while (minutes >= 60)
- {
- hours++;
- minutes -= 60;
- }
- hours %= 24;
- Console.WriteLine("Time Arrival: {0}:{1}:{2}", hours.ToString().PadLeft(2, '0'), minutes.ToString().PadLeft(2, '0'), seconds.ToString().PadLeft(2, '0'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment