HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e【水题】
来源:互联网 发布:smart forfour 知乎 编辑:程序博客网 时间:2024/05/19 02:44
u Calculate e
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 20144 Accepted: 11703 Special Judge
Description
A simple mathematical formula for e is
e=Σ0<=i<=n1/i!
where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.
where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.
Input
No input
Output
Output the approximations of e generated by the above formula for the values of n from 0 to 9. The beginning of your output should appear similar to that shown below.
Sample Input
no input
Sample Output
n e- -----------0 11 22 2.53 2.6666666674 2.708333333...
Source
Greater New York 2000
Regionals 2000 >> North America - Greater NY
问题链接:HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e
问题简述:(略)
问题分析:这是一个简单的计算问题,控制好循环并且注意格式就可以了。
程序说明:(略)
题记:(略)
AC的C语言程序如下:
/* HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e */#include <stdio.h>#define N 9int main(void){ double e = 2.5, f=2.0; int i; printf("n e\n"); printf("- -----------\n"); printf("0 1\n"); printf("1 2\n"); printf("2 2.5\n"); for(i=3; i<=N; i++) { f *= i; e += 1.0 / f; printf("%d %.9f\n", i, e); } return 0;}
阅读全文
0 0
- HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e【水题】
- poj1517 u Calculate e
- 【POJ1517】:u Calculate e
- hdu1012-u Calculate e
- hdu1012-u Calculate e
- hdu1012 u Calculate e
- HDU1012 u Calculate e
- hdu1012 u Calculate e
- HDU1012 u Calculate e
- hdu1012 u Calculate e
- HDU1012 - u Calculate e (水题)
- HDU1012——u Calculate e
- HDU1012 Calculate e
- hdu1012 Calculate e
- ACM-简单题之u Calculate e——hdu1012
- HDU 1012 u Calculate e(水题)
- HDOJ 1012 u Calculate e(水题)
- HDOJ 1012 u Calculate e(水题)
- fingerprint image segmentation
- sys模块
- 35. Search Insert Position
- Angular 4入门教程系列:15:NG-ZORRO的使用方式
- 错题整理
- HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e【水题】
- json
- 「算法精解_C语言描述」链表_循环链表实例 内存页帧置换(图解+实现)
- System Status
- 做决定,怎能让“自己”缺席
- Faster RCNN训练(Matlab版本)结果
- Python数据结构之列表、栈、队列、链表、字典
- 【docker】CMD ENTRYPOINT 区别 终极解读!
- 安装Openfalcon