VioletaBabel

11050번: 이항 계수 1 본문

백준/백준-C++
11050번: 이항 계수 1
Beabletoet 2017. 9. 7. 00:17
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<cstdio>
int main()
{
    int n, k, up=1;
    scanf("%d %d"&n, &k);
    for (int i = n; i > 1--i)
        up *= i;
    for (int i = k; i > 1--i)
        up /= i;
    for (int i = (n - k); i > 1--i)
        up /= i;
    printf("%d", up);
}
cs


'백준 > 백준-C++' 카테고리의 다른 글

10987번: 모음의 개수  (0) 2017.09.07
10988번: 팰린드롬인지 확인하기  (1) 2017.09.07
11586번: 지영 공주님의 마법 거울  (0) 2017.09.07
11653번: 소인수분해  (0) 2017.09.06
2587번: 대표값2  (0) 2017.09.04
Comments