Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Threading;
- class ExamSchedule
- {
- static void Main()
- {
- CultureInfo cultureEnUS = new CultureInfo("en-US");
- Thread.CurrentThread.CurrentCulture = cultureEnUS;
- string hour = Console.ReadLine();
- string minutes = Console.ReadLine();
- string partOfDay = Console.ReadLine();
- string durationHours = Console.ReadLine();
- string durationMinutes = Console.ReadLine();
- string startString = hour + ":" + minutes + partOfDay;
- DateTime examStart = DateTime.Parse(startString);
- string durationString = durationHours + ":" + durationMinutes;
- TimeSpan examDuration = TimeSpan.Parse(durationString);
- DateTime examEnd = examStart.Add(examDuration);
- Console.WriteLine("{0:hh:mm:tt}", examEnd);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement