Advertisement
vasilevaiva

Untitled

Mar 27th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 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 time
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int startHour = int.Parse(Console.ReadLine());
  14. int startMinute = int.Parse(Console.ReadLine());
  15. int timeInMinutes = (startHour * 60) + startMinute;
  16. int timePlus15 = timeInMinutes + 15;
  17. int finalHour = timePlus15 / 60;
  18. int finalMinutes = finalHour / 60;
  19. if (finalHour >= 24)
  20. {
  21. finalHour -= 24;
  22. }
  23. if (finalMinutes < 10)
  24. {
  25. Console.WriteLine("{0}:0{1}", finalHour, finalMinutes);
  26. }
  27. else
  28. {
  29. Console.WriteLine("{0}:{1}", finalHour, finalMinutes);
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement