Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- double hour = double.Parse(Console.ReadLine());
- double minutes = double.Parse(Console.ReadLine());
- double finalHour = 0;
- double finalMinutes = 0;
- if (minutes <= 44)
- {
- finalHour = hour;
- finalMinutes = minutes + 15;
- }
- if (hour >= 24)
- {
- finalHour -= 24;
- }
- else if (minutes >= 45)
- {
- finalHour = hour + 1;
- finalMinutes = minutes - 45;
- }
- Console.WriteLine($"{finalHour}:{finalMinutes:D2}");
- //ако оставя ":D2" ми дава "unhandled exception", ако махна ":D2" ми излиза резултат 2:1, но идеята е релултатът да е 2:01.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement