simeon3000

after 30min 2

May 28th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | None | 0 0
  1.             int hours = int.Parse(Console.ReadLine());
  2.             int minutes = int.Parse(Console.ReadLine());
  3.  
  4.             minutes += 30;
  5.             hours += minutes / 60;
  6.             minutes = minutes % 60;
  7.  
  8.             hours = (hours == 24) ? 0 : hours;
  9.  
  10.             Console.WriteLine($"{hours}:{minutes:d2}");
Advertisement
Add Comment
Please, Sign In to add comment