以下の内容はhttps://inamori.hateblo.jp/entry/20100409/p1より取得しました。


Project Euler 15

http://projecteuler.net/index.php?section=problems&id=15


Combinationは再帰で書くと簡単。なのでメタプログラミングしてみた。

#include <iostream>

template<int N, int M>
struct C {
    static const long long value = C<N,M-1>::value * (N - M + 1) / M;
};

template<int N>
struct C<N, 0> {
    static const long long value = 1;
};

int main() {
    std::cout << C<40,20>::value << std::endl;
}



以上の内容はhttps://inamori.hateblo.jp/entry/20100409/p1より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14