用一重循环编程计算s=1!+2!+3!+4!+…+20!
#include<stdio.h>int main(){float s=0,t=1;int n;for(n=1;n<=20;n++){t=t*n;s=s+t;}printf("%e\n",s);return 0;}
调用函数