1. 最前面的格式要记得输入.

2. 计算的时候要从3开始重新计算, 否则会丢失精度.

3. 更快的方式就是打表.

#include <iostream>
using namespace std; // 5 120
// 6 720
// 7 5040
// 8 40320
// 9 362880 int main(){
cout<<"n e"<<endl;
cout<<"- -----------"<<endl;
double ans[] = {,,2.5,,,,,,,};
for(int i=;i<;++i){
cout<<i<<" "<<ans[i]<<endl;
}
cout.precision();
for(int i=;i<;++i){
ans[i] = ans[i-] + (double)1.0/ans[i];
cout<<i<<" "<<ans[i]<<endl;
} return ;
}


-->

1517 u Calculate e的更多相关文章

  1. poj 1517 u Calculate e

    u Calculate e Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19465   Accepted: 11362   ...

  2. OpenJudge/Poj 1517 u Calculate e

    1.链接地址: http://bailian.openjudge.cn/practice/1517 http://poj.org/problem?id=1517 2.题目: 总时间限制: 1000ms ...

  3. poj 1517 u Calculate e(精度控制+水题)

    一.Description A simple mathematical formula for e is e=Σ0<=i<=n1/i! where n is allowed to go t ...

  4. 算法之路 level 01 problem set

    2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...

  5. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  6. 【HDU】1517 A Multiplication Game

    http://acm.hdu.edu.cn/showproblem.php?pid=1517 题意:每次乘上2~9..p>=n时赢.. #include <cstdio> #incl ...

  7. [转] PHP计算两个坐标之间的距离, Calculate the Distance Between Two Points in PHP

    Calculate the Distance Between Two Points in PHP There are a lot of applications where it is useful ...

  8. CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved

    CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin ...

  9. maven -- 问题解决(二)解决“Could not calculate build plan”问题

    错误提示如下:(eclipse+maven) Could not calculate build plan: Failure to transfer org.apache.maven.plugins: ...

随机推荐

  1. Java堆外内存之一:堆外内存场景介绍(对象池VS堆外内存)

    最近经常有人问我在Java中使用堆外(off heap)内存的好处与用途何在.我想其他面临几样选择的人应该也会对这个答案感兴趣吧. 堆外内存其实并无特别之处.线程栈,应用程序代码,NIO缓存用的都是堆 ...

  2. PHP中实现函数重载

    转载自:http://cnn237111.blog.51cto.com/2359144/1284085 由于PHP是弱类型语言,因此函数的输入参数类型无法确定(可以使用类型暗示,但是类型暗示无法用在诸 ...

  3. 《Java核心技术》 -- 读书笔记 ② - 类 | 对象 | 接口

    对象vs对象变量 “对象” 描述的是一个类的具体实例,他被java虚拟机分配在 "堆" (Heap)中. “对象变量” 为一个对象的引用(对象变量的值=记载着具体对象的位置/地址) ...

  4. node中express的中间件之cookieParser

    cookieParser中间件用于获取web浏览器发送的cookie中的内容.在使用了cookieParser中间件后, 代表客户端请求的htto.IncomingMessage对象就具有了一个coo ...

  5. Oracle查看和修改连接数

    1.查询数据库当前进程的连接数:   select count(*) from v$process;   2.查看数据库当前会话的连接数:   elect count(*) from v$sessio ...

  6. sql sever数据库常用的执行语句

    --使用master数据库use master --创建数据库文件create database 数据库名字 on( name=, --逻辑名称 filename= .ndf, --数据文件物理路径名 ...

  7. Git学习之常用的命令

    配置git git config --global user.name "你的github用户名" git config --global user.email "你的G ...

  8. 渗透辅助神器 - DZGEN

    项目地址:https://github.com/joker25000/DZGEN git clone ┌─[root@sch01ar]─[/sch01ar] └──╼ #git clone https ...

  9. [BZOJ][CQOI2014]数三角形

    Description 给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个.下图为4x4的网格上的一个三角形. 注意三角形的三点不能共线. Input 输入一行,包含两个空格分隔的正整数m和 ...

  10. 21_java之File对象和递归遍历

    01IO技术概述 * A:IO技术概述 * a: Output * 把内存中的数据存储到持久化设备上这个动作称为输出(写)Output操作 * b: Input * 把持久设备上的数据读取到内存中的这 ...