Advertisement
dragonbs

Back in 30 minutes

Feb 7th, 2023
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | None | 0 0
  1. int hours = int.Parse(Console.ReadLine());
  2. int minutes = int.Parse(Console.ReadLine()) + 30;
  3.  
  4. if (minutes > 59)
  5. {
  6.     hours += 1;
  7.     minutes -= 60;
  8. }
  9. if (hours > 23)
  10. {
  11.     hours = 0;
  12. }
  13. Console.WriteLine("{0}:{1:D2}", hours, minutes);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement