Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- class ExamTime
- {
- static void Main()
- {
- string hour = Console.ReadLine();
- string minutes = Console.ReadLine();
- string partOfDay = Console.ReadLine().ToLower();
- int examHours = int.Parse(Console.ReadLine());
- int examMinutes = int.Parse(Console.ReadLine());
- string time = hour + ":" + minutes + ":" + partOfDay;
- DateTime startTime = DateTime.ParseExact(time, "h:mm:tt", CultureInfo.InvariantCulture);
- DateTime endTime = startTime.AddHours(examHours).AddMinutes(examMinutes);
- Console.WriteLine(endTime.ToString("hh:mm:tt"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement