用C语言编程求1!+2!+.......+n!
用C语言编程求1!+2!+.......+n!
日期:2009-06-04 13:05:01 人气:1
# include "iostream.h"
int Fun(int n){
int sum=1,i=1,SUM=0;
for(i=1;i<=n;i++){
sum*=i;
SUM+=sum;
}
return SUM;
}
void main(){
int n;
cout<<"你要计算1的阶层加到n的阶层,请输入n\nn: ";
cin>>n;
cou