题解 1071: 二级C语言-阶乘公式求值

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

1071题 阶乘公式求职-题解(C++)

#include#includeusingnamespacestd;doublefact(intk){doubleres;if(k==1)res=1.0;elseres=k*fact(k-1);returnres;}intmain(){intn;cin>>n;doublesum=0;for(inti=