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-Runoob-面向对象:Java 接口

    ylbtech-Java-Runoob-面向对象:Java 接口 1.返回顶部 1. Java 接口 接口(英文:Interface),在JAVA编程语言中是一个抽象类型,是抽象方法的集合,接口通常以 ...

  2. 004:MySQL数据库体系结构

    目录 一. MySQL数据库体系结构 1.MySQL数据库体系结构介绍 1 数据库定义 2 数据库实例 2. MySQL体系结构 1 单进程多线程结构 2 存储引擎的概念 3 体系结构图 4 逻辑存储 ...

  3. ALSA声卡笔记1---ALSA驱动框架

    1.声卡驱动程序sound.c (1)入口函数里通过register_chrdev()函数注册file_operations 结构体 (2)file_operations 结构体,里面只有open函数 ...

  4. IOCP的缓冲区

    IOCP的缓冲区: 应用程序的缓冲区 套接字的缓冲区 TCP的缓冲区 两个会造成WSAENOBUFS错误的原因: 锁定页面达到上限 非分页页面达到上限

  5. 浅谈PHP面向对象编程(七、抽象类与接口)

    7.0 抽象类与接口 当定义一个类时,常常需要定义一些方法来描述该类的行为特征.但有时这些方法的实现方式是无法确定的,此时就可以使用抽象类和接口. 抽象类和接口用于提高程序的灵活性.抽象类是一种特殊的 ...

  6. python基础知识之列表、元祖、字典、集合、字符串。

    1.可变类型之列表 列表用 [ ]来定义是可变的,可以通过索引值来去查询里面的字段可以可以追加,删除等 names='zhangyang guyun xiangpeng xuliangwei' nam ...

  7. python学习笔记(十二):发送邮件

    我们在开发程序的时候,有时候需要开发一些自动化的任务,执行完之后,将结果自动的发送一份邮件,python发送邮件使用smtplib模块,是一个标准包,直接import导入使用即可,代码如下: impo ...

  8. c#中的序列化

    1.对象的序列化 NET支持对象序列化有以下几种方式:二进制序列化:对象序列化之后是二进制形式的,通过BinaryFormatter类来实现的,这个类位于System.Runtime.Serializ ...

  9. android 2.3.3 配置github的两步骤

    第一步:配置GitHub的总账号(Version Control) 第二步:配置具体的仓库(仓库名称你从GitHub网上添加)

  10. Balls(poj 3783)

    The classic Two Glass Balls brain-teaser is often posed as: “Given two identical glass spheres, you ...