Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _1.ExamSchedule
- {
- using System;
- using System.Globalization;
- using System.Threading;
- public class CalculateTimeTheExamEnd
- {
- public static void Main(string[] args)
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- checked
- {
- string startHour = Console.ReadLine();
- string startMinutes = Console.ReadLine();
- string partOfDay = Console.ReadLine();
- int durationHours = int.Parse(Console.ReadLine());
- int durationMinutes = int.Parse(Console.ReadLine());
- string timeStr = startHour + ':' + startMinutes + ' ' + partOfDay;
- DateTime startTime = DateTime.Parse(timeStr);
- DateTime endTime = startTime.AddHours((double)durationHours);
- endTime = endTime.AddMinutes((double)durationMinutes);
- Console.WriteLine(endTime.ToString("hh:mm:tt"));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement