Advertisement
desislava_topuzakova

Untitled

May 2nd, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Time_15Min
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int hour = int.Parse(Console.ReadLine());
  10. int min = int.Parse(Console.ReadLine());
  11.  
  12. int sum = ((hour * 60) + min + 15);
  13. int resultHour = sum / 60;
  14. if (resultHour >= 24)
  15. {
  16. resultHour -= 24;
  17. }
  18. int resultMin = sum % 60;
  19.  
  20. Console.WriteLine($"{resultHour}:{resultMin:D2}");
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement