Advertisement
DON_DOBRINIO

Time + 15 Minutes

Jun 29th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 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_plus_15_Minutes
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var hours = int.Parse(Console.ReadLine());
  14. var mins = int.Parse(Console.ReadLine());
  15.  
  16. int new_Time = mins + 15;
  17.  
  18. if (new_Time > 59)
  19. {
  20. hours += 1;
  21. new_Time -= 60;
  22. if (hours > 23 && new_Time > 9)
  23. {
  24. Console.WriteLine(0 + ":" + new_Time);
  25. }
  26. else if (hours > 23 && new_Time < 10)
  27. {
  28. Console.WriteLine(0 + ":" + 0 + new_Time);
  29. }
  30. }
  31. else
  32. {
  33. Console.WriteLine(hours + ":" + new_Time);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement