백준 10250 ACM호텔

Console Programming/C# Console 2019. 11. 13. 08:59
using System;

namespace _10250
{
    class Program
    {
        static void Main(string[] args)
        {
            int testInput = int.Parse(Console.ReadLine());
            for (int k = 0; k < testInput; k++)
            {
                string[] strInput = Console.ReadLine().Split(' ');

                int row = int.Parse(strInput[0]);
                int col = int.Parse(strInput[1]);
                int g = int.Parse(strInput[2]);

                int cnt = 0;
                int a = 0;
                int b = 0;

                for (int i = 0; i < col; i++)
                {
                    for (int j = 0; j < row; j++)
                    {
                        a = (j + 1);
                        b = (i + 1);

                        cnt++;
                        if (cnt == g)
                        {
                            break;
                        }
                    }
                    if (cnt == g)
                    {
                        break;
                    }

                }

                if (b < 10)
                {
                    Console.WriteLine(a + "0" + b);
                }
                else
                {
                    Console.WriteLine(a + "" + b);
                }
            }

        }
    }
}

 

'Console Programming > C# Console' 카테고리의 다른 글

Delegate 사용. App의 Delegate객체가 Hero,Monster관리  (0) 2019.11.26
백준 2775 부녀회장이 될거야  (0) 2019.11.13
백준 2292 벌집  (0) 2019.11.07
백준 1193 분수찾기  (0) 2019.11.06
백준 1157 단어 공부  (0) 2019.11.05
: