u Calculate e - 1517
来源:互联网 发布:浏览器ip代理软件 编辑:程序博客网 时间:2024/06/08 10:23
u Calculate e
Time Limit: 1000MS
Memory Limit: 10000KTotal Submissions: 19242
Accepted: 11267
Special Judge
Memory Limit: 10000KTotal Submissions: 19242
Accepted: 11267
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
法1:由于题中就让输出10以内的n,采用递归比较简单:
法2:采用递推也可以,如果n比较大的情况下,采用递推可以节省时间:
0 0
- u Calculate e - 1517
- pku 1517 u Calculate e
- POJ 1517 u Calculate e
- [POJ]1517 u Calculate e
- poj 1517 u Calculate e
- poj 1517 u Calculate e
- POJ 1517 u Calculate e
- poj 1517 u Calculate e
- 【poj 1517】 u Calculate e
- POJ 1517 u Calculate e
- POJ 1517 u Calculate e 笔记
- u Calculate e
- u Calculate e
- JOJ1020: u Calculate e
- u calculate e
- u Calculate e
- poj1517 u Calculate e
- 1012 u Calculate e
- jar包的用途
- GAZEBO
- rmmod: chdir(xxx): No such file or directory 解决方法
- 中国电信IT研发中心一面总结
- NSArray排序
- u Calculate e - 1517
- 讲座:与迷茫相伴的IT成长路
- ibatis 条件查询
- 乱码转换
- mac: macVim 安装颜色主题
- ListView 嵌套listView 怎么实现,及关于焦点问题的解决。
- 欧拉函数之HDU4983 Goffi and GCD
- Redis windons安装
- UML 继承 实现 依赖 关联