Files
BasicsOfComputerSoftwareEng…/OOP/test.cpp
2023-05-18 19:48:28 +08:00

20 lines
345 B
C++

#include <iostream>
using std::cout;
using std::cin;
using std::endl;
template <int x>
struct Factorial {
static const unsigned long long value = x * Factorial<x-1>::value;
};
template <>
struct Factorial<0> {
static const unsigned long long value = 1;
};
int main() {
Factorial<20> a;
cout << a.value << endl;
return 0;
}