【C语言】求1+2!+3!+...+20!的和

来源:互联网 发布:免费翻墙 知乎 编辑:程序博客网 时间:2024/04/28 19:29
#include "stdio.h"main(){  float n,s=0,t=1;  for(n=1;n<=20;n++)  {    t*=n;    s+=t;  }  printf("1+2!+3!...+20!=%e\n",s);  getch();}


本文出自 “Vs吕小布” 博客,请务必保留此出处http://survive.blog.51cto.com/10728490/1698354

0 0