Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- typedef long long ll;
- template< ll n >
- struct Factorial {
- const static ll value = Factorial< n - 1 >::value * n;
- };
- template<>
- struct Factorial< 1 > {
- const static ll value = 1;
- };
- int main() {
- printf("%lld\n", Factorial< 10 >::value);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement