21 lines
411 B
C++
21 lines
411 B
C++
#include <iostream>
|
|
using std::cin;
|
|
using std::cout;
|
|
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;
|
|
int x = 1;
|
|
double b = 3;
|
|
cout << x / b * 3 << endl;
|
|
return 0;
|
|
} |