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. pagination实现分页功能

    pagination.js: /** * pagination分页插件 */ ;(function($,window,document,undefined){ //配置参数 var defaults ...

  2. 缺乏libaio包导致报The server quit without updating PID file

    背景: 直接解压安装mysql5.7.18,解压mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz,直接拷贝另外一台数据库的数据目录,启动mysql过程无日志输出,报E ...

  3. SpingData 的学习

    Spring Data : Spring 的一个子项目,类似于Sping MVC 一样是Spring的另一个模块,所以还需要下载其jar ,它需要的jar有: spring-data-jpa-1.11 ...

  4. Cocos开发前准备

    Cocos2d-HTML5( http://www.cocos2d-x.org )引擎 代码编辑器:webstorm (http://www.jetbrains.com/)+ Sublime Text ...

  5. NodeJS写模块和引入模块的例子

    nodejs自学.js function hello(){ console.log("hello world");} function s(){ console.log(" ...

  6. svn使用常用错误

    描述 :SVN更新提交显示文件被锁异常: Working copy XXXXXXXX locked Please execute "Cleanup" command 原因 : 待查 ...

  7. sqlldr详解

    Oracle 的SQL*LOADER可以将外部数据加载到数据库表中.下面是SQL*LOADER的基本特点: 1)能装入不同数据类型文件及多个数据文件的数据2)可装入固定格式,自由定界以及可度长格式的数 ...

  8. Rhythmk 一步一步学 JAVA (17):Servlet 文件上传

    1.环境 : JDK 1.6 , Tomcat 7.0 2.第三方类库: commons-fileupload-1.3.1.jar commons-io-2.4.jar 3.web.xml配置: &l ...

  9. IDEA2018.2版本注册

    IntelliJ IDEA 2018.2版本注册 1.到官网下载IDEA安装文件,windows版本ideaIU-2018.2.2.exe,然后安装: 2.下载补丁包JetbrainsCrack-3. ...

  10. UNITY 模型与动画优化选项

    1,RIG: Optimze Game Objects,[默认是没勾选的] 效果:将骨骼层级从模型中移除,放到动画控制器中,这样性能提高明显.实测中发现原来瞬间加载5个场景角色有点延迟,采用此选项后流 ...