본문 바로가기

코딩/백준

C# <10950번:A+B-3> 백준문제풀이

728x90
반응형

 

 

using System;



namespace ConsoleApp2
{
    internal class Program
    {





        static void Main(string[] args)
        {
            string Input = Console.ReadLine();
            string[] split_Input = Input.Split(' ');
            int a = int.Parse(split_Input[0]);
            int b = int.Parse(split_Input[1]);

            if (b > 45)
            {
                b -= 45;
            }

            else if (b < 45)
            {
                if (a == 0)
                {
                    a = 24;
                }
                a -= 1;
                b = b + 60 - 45;
            }

            else
            {
                b = 0;
            }

            
            Console.WriteLine(a + " " + b);


        }
    }
}
 
 

 

 

반응형