Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01SinoTheWalker
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] times = Console.ReadLine().Split(':').Select(int.Parse).ToArray();
- uint stepsCount = uint.Parse(Console.ReadLine());
- uint stepTime = uint.Parse(Console.ReadLine());
- BigInteger addedSeconds = stepsCount * stepTime;
- GetArrivalTime(times, addedSeconds);
- }
- private static void GetArrivalTime(int[] times, BigInteger addedSeconds)
- {
- BigInteger totalSeconds = addedSeconds + times[2] + times[1] * 60 + times[0] * 3600;
- int hours = (int)(totalSeconds / 3600);
- int remainder = (int)(totalSeconds % 3600);
- int minutes = remainder / 60;
- int seconds = remainder % 60;
- if (hours > 23)
- {
- hours %= 24;
- }
- Console.WriteLine($"Time Arrival: {hours:d2}:{minutes:d2}:{seconds:d2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment