[阅读: 702] 2009-01-22 16:15:33
#include <iostream>
using namespace std;
template<int T>
struct factorial {
enum { value = T * factorial<T - 1>::value };
};
template<>
struct factorial<0> {
enum { value = 1 };
};
int main()
{
cout << factorial<6>::value << endl;
return 0;
}
机器人,
这首歌学会了没有?
我们的目标是->没有蛀牙!