fork download
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main(string[] args)
  6. {
  7. string[] s = Console.ReadLine().Split(" ");
  8. int ss= int.Parse(Console.ReadLine());
  9. int t = 0;
  10.  
  11. if (int.Parse(s[0]) == 23 && (int.Parse(s[1]) + ss) > 59)
  12. {
  13. t = (0 + (int.Parse(s[1]) + ss))-60;
  14. }
  15. else
  16. {
  17. t = (int.Parse(s[0]) * 60) + (int.Parse(s[1]) + ss);
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. Console.WriteLine(t/60 + " " + t%60);
  26.  
  27.  
  28.  
  29. }
  30. }
Success #stdin #stdout 0.05s 28060KB
stdin
20 30
300
stdout
25 30