/ Published in: C++
Expand |
Embed | Plain Text
template<class T> T Factorial (T n) { //计算n! if (n<=1) return 1; else return n * Factorial(n- 1 ) ; }
You need to login to post a comment.
template<class T> T Factorial (T n) { //计算n! if (n<=1) return 1; else return n * Factorial(n- 1 ) ; }
You need to login to post a comment.