Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- public class Program
- {
- public static void Main()
- {
- string input = Console.ReadLine();
- string[] split = input.Split(':');
- ulong hour = ulong.Parse(split[0]);
- ulong minites = ulong.Parse(split[1]);
- ulong secounds = ulong.Parse(split[2]);
- ulong numberSteps = ulong.Parse(Console.ReadLine());
- ulong stepSeconds = ulong.Parse(Console.ReadLine());
- ulong total = numberSteps * stepSeconds + (hour * 60 * 60) + (minites * 60) + secounds;
- ulong hour1 = total / 60 / 60;
- ulong hour2 = (total - hour1 * 3600) / 60;
- ulong hour3 = (total - hour1 * 3600) % 60;
- string printsHours = "" + hour1;
- string printsMinutes = "" + hour2;
- string printsSecounds = "" + hour3;
- if (hour1 > 24)
- {
- hour1 = hour1 % 24;
- }
- if (hour2 > 60)
- {
- hour1 = hour1 % 60;
- }
- if (hour1 < 10)
- {
- printsHours = "" + 0 + hour1;
- }
- if (hour2 < 10)
- {
- printsMinutes = "" + 0 + hour2;
- }
- if (hour3 < 10)
- {
- printsSecounds = "" + 0 + hour3;
- }
- /*Console.WriteLine(total);
- Console.WriteLine(printsHours);
- Console.WriteLine(printsMinutes);
- Console.WriteLine(printsSecounds);*/
- Console.WriteLine("Time Arrival: " + printsHours + ":" + printsMinutes + ":" + printsSecounds);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement