Advertisement
ceco_sht

Untitled

Oct 23rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _15min_Time
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int hours = int.Parse(Console.ReadLine());
  10. int minutes = int.Parse(Console.ReadLine());
  11.  
  12.  
  13. if (minutes > 59)
  14. {
  15. hours = hours + 1;
  16. minutes = minutes - 60;
  17. }
  18. else if (minutes > 45)
  19. {
  20. hours = hours + 1;
  21. minutes = minutes - 60;
  22. }
  23. else
  24. {
  25. minutes = minutes + 15;
  26. }
  27. if (hours > 23)
  28. {
  29. hours = hours - 24;
  30. }
  31. if (minutes < 10)
  32. {
  33. Console.WriteLine(hours + ":" + "0" + minutes);
  34. }
  35. else
  36. {
  37. Console.WriteLine(hours + ":" + minutes);
  38. }
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement