#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(); }
【C语言】求1+2!+3!+...+20!的和
原创
©著作权归作者所有:来自51CTO博客作者Vs吕小布的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:【C语言】输入十个数求最大数
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
java 输出1^1+2^2+3^3+.....+20^20 递归
可以采用递归 有需要一直循环的内容
java 输出1^1+2^2+3^3+. -
求1+2!+3!+...+20!的和
求1+2!+3!+...+20!的和public class Lesson3 { public static void main(String[] args) {
求1+2+3+...+20的和 i++ System