/* 求:1+2!+3!+...+N! */ #include <stdio.h> #include<string.h> void main(int argc,char *argv[]) { int sum,i,j,n,temp; scanf("%d",&n); sum=0; for(i=1;i<=n;i++){ temp=1; for(j=1;j<=i;j++){ temp=temp*j; } sum+=temp; } printf("%d\n",sum); }
求:1+2!+3!+...+N!
猜你喜欢
转载自www.cnblogs.com/zhaohuan1996/p/11812142.html
今日推荐
周排行