백준 2775 부녀회장이 될거야
Console Programming/C# Console 2019. 11. 13. 10:33using System;
namespace _2775
{
class Program
{
static void Main(string[] args)
{
int testInput = int.Parse(Console.ReadLine());
for(int m =0; m < testInput; m++)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int[,] arr = new int[a + 1, b + 1];
for (int i = 1; i < b + 1; i++)
{
arr[0, i] = i;
}
for (int i = 1; i < a + 1; i++)
{
for (int j = 1; j < b + 1; j++)
{
int sum = 0;
for (int k = 0; k < j + 1; k++)
{
sum += arr[i - 1, k];
}
arr[i, j] = sum;
}
}
Console.WriteLine(arr[a, b]);
}
}
}
}
'Console Programming > C# Console' 카테고리의 다른 글
Event와 Delegate를 사용한 Hero의 Move(), Attack() //Monster의 Hit() 구현 (0) | 2019.11.29 |
---|---|
Delegate 사용. App의 Delegate객체가 Hero,Monster관리 (0) | 2019.11.26 |
백준 10250 ACM호텔 (0) | 2019.11.13 |
백준 2292 벌집 (0) | 2019.11.07 |
백준 1193 분수찾기 (0) | 2019.11.06 |