Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- class ExamSchedule
- {
- static void Main()
- {
- string startHours = Console.ReadLine();
- string startMinutes = Console.ReadLine();
- string startPartOfTheDay = Console.ReadLine();
- int durationHours = int.Parse(Console.ReadLine());
- int durationMinutes = int.Parse(Console.ReadLine());
- DateTime startTime = DateTime.Parse(startHours + ":" + startMinutes + " " + startPartOfTheDay);
- startTime = startTime.AddHours(durationHours);
- startTime = startTime.AddMinutes(durationMinutes);
- Console.WriteLine("{0:hh:mm tt}",startTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement