Guest User

Untitled

a guest
Feb 7th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 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 number_to_text
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int h = int.Parse(Console.ReadLine());
  14. int m = int.Parse(Console.ReadLine());
  15. int m1 = m + 15;
  16.  
  17.  
  18. //works
  19. if (h <= 23 && m1 >= 10 && m1 < 60)
  20. {
  21. Console.WriteLine($"{h}:{m1}");
  22. }
  23.  
  24. else if (h <= 23 && m1 < 10)
  25. {
  26. Console.WriteLine($"{h}:0{m1}");
  27. }
  28. else if (h < 23 && m1 >= 60)
  29. {
  30. h = h + 1;
  31. m1 = m1 - 60;
  32. Console.WriteLine($"{h}:{m1.ToString("00")}");
  33. }
  34. //works
  35. else if (h == 23 && m1 >= 60)
  36. {
  37. m1 = m1 - 60;
  38. Console.WriteLine($"0:{m1.ToString("00")}");
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment