Advertisement
kzborisov

Time + 15

Sep 19th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. sing System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Time_Plus_Fifteen
  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.  
  16.  
  17. var plus15 = minutes + 15;
  18.  
  19. if (plus15 <= 59)
  20. {
  21. Console.WriteLine("{0}:{1:D2}", hour, plus15);
  22. }
  23. else if (plus15 > 59)
  24. {
  25. Console.WriteLine("{0}:{1:D2}", (hour + 1) % 24, plus15 - 60);
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement