Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MinutesPlus15
- {
- class Program
- {
- static void Main()
- {
- int hour = int.Parse(Console.ReadLine());
- int minute = int.Parse(Console.ReadLine());
- int result = hour * 60 + minute + 15;
- int totalhour = result / 60;
- int totalminute = result % 60;
- if (totalminute == 0 && totalhour <= 23)
- {
- Console.WriteLine($"{totalhour}:00");
- }
- else if (totalminute == 0 && totalhour >= 24)
- {
- Console.WriteLine($"{totalhour % 24}:00");
- }
- else if (totalminute < 10 && totalhour <=23 )
- {
- Console.WriteLine($"{totalhour}:0{totalminute}");
- }
- else if (totalhour <= 23)
- {
- Console.WriteLine($"{totalhour}:{totalminute}");
- }
- else if (totalhour >= 24 && totalminute < 10)
- {
- Console.WriteLine($"{totalhour % 24}:0{totalminute}");
- }
- else if (totalhour >= 24 && totalminute > 10)
- {
- Console.WriteLine($"{totalhour % 24}:{totalminute}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment