Advertisement
Guest User

sfaf

a guest
Jan 16th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. int examHour = int.Parse(Console.ReadLine());
  8. int examMinute = int.Parse(Console.ReadLine());
  9. int comeHour = int.Parse(Console.ReadLine());
  10. int comeMinute = int.Parse(Console.ReadLine());
  11.  
  12. int start = examHour * 60 + examMinute;
  13. int come = comeHour * 60 + comeMinute;
  14.  
  15.  
  16. if (start > come && start - come < 60 && start - come <= 30)
  17. {
  18. Console.WriteLine("On time {0} minutes before the start", start - come);
  19.  
  20. }
  21. else if (start > come && start - come > 60 && start - come <= 30)
  22. {
  23. Console.WriteLine("On time {0}:{1} hours before the start", (start - come) / 60, (start - come) % 60);
  24. }
  25. else if (start < come && come - start < 60)
  26. {
  27. Console.WriteLine("Late {0} minutes after the start", come - start);
  28. }
  29. else if (start < come && come - start >= 60)
  30. {
  31. Console.WriteLine("Late {0}:{1} hours after the start", (come - start) / 60, (come - start) % 60);
  32. }
  33. else if (start == come)
  34. {
  35. Console.WriteLine("On time");
  36. }
  37. else if (start > come && start - come > 30 && start - come < 60)
  38. {
  39. Console.WriteLine("Early {0} minutes before the start", start - come);
  40. }
  41. else if (start > come && start - come > 30 && start - come > 60)
  42. {
  43. Console.WriteLine("Early {0}:{1} hours before the start", (start - come) / 60, (start - come) % 60);
  44. }
  45. else if (start > come && start - come > 30 && start - come == 60)
  46. {
  47. Console.WriteLine("Early {0}:00 hours before the start", (start - come) / 60);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement