C 练习实例25

C 语言教程 · 2019-02-21 18:12:04

题目:求1+2!+3!+...+20!的和。

程序分析:此程序只是把累加变成了累乘。

实例

// Created by www.codercto.com on 15/11/9. // Copyright © 2015年 码农教程. All rights reserved. // #include <stdio.h> int main() { int i; long double sum,mix; sum=0,mix=1; for(i=1;i<=20;i++) { mix=mix*i; sum=sum+mix; } printf("%Lf\n",sum); }

以上实例输出结果为:

2561327494111820313.000000

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

Hackers

Hackers

Steven Levy / O'Reilly Media / 2010-5-30 / USD 21.99

This 25th anniversary edition of Steven Levy's classic book traces the exploits of the computer revolution's original hackers -- those brilliant and eccentric nerds from the late 1950s through the ear......一起来看看 《Hackers》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具