Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace number_to_text
- {
- class Program
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int m1 = m + 15;
- //works
- if (h <= 23 && m1 >= 10 && m1 < 60)
- {
- Console.WriteLine($"{h}:{m1}");
- }
- else if (h <= 23 && m1 < 10)
- {
- Console.WriteLine($"{h}:0{m1}");
- }
- else if (h < 23 && m1 >= 60)
- {
- h = h + 1;
- m1 = m1 - 60;
- Console.WriteLine($"{h}:{m1.ToString("00")}");
- }
- //works
- else if (h == 23 && m1 >= 60)
- {
- m1 = m1 - 60;
- Console.WriteLine($"0:{m1.ToString("00")}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment