中国开发网: 论坛: 超级垃圾站: 贴子 698657
龙之吻
这样写就好理解拉.
#include <iostream>
using namespace std;

template<int T>
class factorial {
public: static const int value = T * factorial<T - 1>::value ;
};

template<>
class factorial<0> {
public: static const int value = 1 ;
};


int main()
{
cout << factorial<6>::value << endl;
return 0;
}


机器人,这首歌学会了没有?

我们的目标是->没有蛀牙!

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录