【poj 1517】 u Calculate e
2016-10-18 13:11
330 查看
题意:
n从0到9时,计算e的值分别是多少。思路:
模拟即可。代码:
#include <iostream> #include <cstdio> using namespace std; typedef double db; int main(){ printf("n e\n- -----------\n"); printf("0 1\n"); db now = 1, ans = 1; for(int i = 1; i <= 9; i ++, now*=i) ans += 1/now, printf("%d %.9f\n", i, ans); return 0; }
相关文章推荐
- poj 1517 & hdu 1012 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
- OpenJudge/Poj 1517 u Calculate e
- [POJ]1517 u Calculate e
- POJ 1517 u Calculate e
- (Relax ST1.8)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(精度控制+水题)
- HDU 1517 && poj 2505 A Multiplication Game (基础博弈)
- POJ 1517 解题报告
- POJ 2505 && HDU 1517 A multiplication game(博弈论)
- 结题报告:POJ_1517
- POJ 1517 && HDU 1012 u Calculate e(水~)