Advertisement
reathh

01.ExamSchedule

Apr 24th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _01_Exam_Schedule
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int hour = int.Parse(Console.ReadLine());
  14.             int minutes = int.Parse(Console.ReadLine());
  15.             string partofday = Console.ReadLine();
  16.  
  17.  
  18.             int ehours = int.Parse(Console.ReadLine());
  19.             int eminutes = int.Parse(Console.ReadLine());
  20.  
  21.  
  22.             DateTime thetime = new DateTime();
  23.             thetime = DateTime.Parse(hour + ":" + minutes + " " + partofday);
  24.  
  25.  
  26.             DateTime endofexam = thetime.AddHours(ehours).AddMinutes(eminutes);
  27.  
  28.             string result = endofexam.ToString("hh:mm:tt");
  29.  
  30.             Console.WriteLine(result);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement