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

查看所有标签

The Algorithm Design Manual

The Algorithm Design Manual

Steve S. Skiena / Springer / 1998-8-1 / GBP 53.91

Contents u Techniques u Introduction to Algorithms u Correctness and Efficiency u Correctness u Efficiency u Expressing Algorithms u Keeping Score u The RAM Model of Computatio......一起来看看 《The Algorithm Design Manual》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具