先谢谢了热心的两位朋友,不要位一道题,伤了和气,这是我写的代码:long int sum=0; int j=0,k=0,i=0; printf("please input:"); scanf("%ld",&i);
for(j=0;j<=i;j++) { for(k=i-1;k>0;k--) { i=i*k; printf("%d\n",i); } sum+=i; printf("%ld\n",sum); } printf("the result is:%ld\n",sum);