#include <iostream>

template <int N>
struct Factorial
{
    enum
	{
		value = N * Factorial<N - 1>::value
	};
};
 
template <>
struct Factorial<0>
{
    enum
	{
		value = 1
	};
};

unsigned int factorial(unsigned int n)
{
    return (n == 0)? 1 : n * factorial(n - 1); 
}

using namespace std;

int main()
{
  const int x = factorial(0);
  const int y = factorial(10);
  const int z = Factorial<0>::value;
  const int v = Factorial<10>::value;

  cout << x << endl
       << y << endl
       << z << endl
       << v << endl;

  return 0;
}