Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Globalization;
- namespace ExamSchedule
- {
- class ExamSchedule
- {
- static void Main(string[] args)
- {
- string startHour = Console.ReadLine();
- string startMinute = Console.ReadLine();
- string partOfDay = Console.ReadLine();
- int examhours = int.Parse(Console.ReadLine());
- int examMinutes = int.Parse(Console.ReadLine());
- CultureInfo culture = CultureInfo.GetCultureInfo("en-US");
- string timeExamStart = startHour + ":" + startMinute + " " + partOfDay;
- DateTime startTime = Convert.ToDateTime(timeExamStart, culture);
- DateTime endHours = startTime.AddHours(examhours);
- DateTime endTime = endHours.AddMinutes(examMinutes);
- Console.WriteLine(endTime.ToString("hh:mm:tt", culture));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment