1517 u Calculate e
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的更多相关文章
- poj 1517 u Calculate e
u Calculate e Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 19465 Accepted: 11362 ...
- OpenJudge/Poj 1517 u Calculate e
1.链接地址: http://bailian.openjudge.cn/practice/1517 http://poj.org/problem?id=1517 2.题目: 总时间限制: 1000ms ...
- 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 ...
- 算法之路 level 01 problem set
2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- 【HDU】1517 A Multiplication Game
http://acm.hdu.edu.cn/showproblem.php?pid=1517 题意:每次乘上2~9..p>=n时赢.. #include <cstdio> #incl ...
- [转] 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 ...
- 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 ...
- maven -- 问题解决(二)解决“Could not calculate build plan”问题
错误提示如下:(eclipse+maven) Could not calculate build plan: Failure to transfer org.apache.maven.plugins: ...
随机推荐
- HBase之八--(2):HBase二级索引之Phoenix
1. 介绍 Phoenix 是 Salesforce.com 开源的一个 Java 中间件,可以让开发者在Apache HBase 上执行 SQL 查询.Phoenix完全使用Java编写,代码位于 ...
- CodeForces - 963B Destruction of a Tree (dfs+思维题)
B. Destruction of a Tree time limit per test 1 second memory limit per test 256 megabytes input stan ...
- bytes数据类型和字符串的编码解码,三元运算,进制互换
三元运算 如果这个条件成立就存这个值,如果那个条件成立就存那个值. 进制 bytes类型,字节数据类型也就是二进制类型,这个是python3专有数据类型,在python2里跟字符串是一个类型,也就是p ...
- PorterDuff.Mode
参考:http://weishu.me/2015/09/23/Xfermode-in-android/ Sa = Source alphaDa = Dest alphaSc = Source colo ...
- mysql语句求按字段分组后组数是多少
select count(distinct ID) from table Thinkphp CURD写 $count = $model->where($where)->count('dis ...
- java实现时钟方法汇总
import java.awt.Dimension; import java.text.SimpleDateFormat; import java.util.Calendar; import java ...
- ethereum
几个网址 https://github.com/ethereum/go-ethereum/wikihttp://ethfans.org windows下安装以太币钱包 从下面网址下载钱包,不用安装是绿 ...
- Hp培训学习注册攻略
输入h20507.www2.hp.com/Saba/Web/Main用以注册的Hp partner portnal账户登入,
- Android 4 学习(20):ActionBar
参考<Pro Android 4.0> ActionBar 11.0之后,ActionBar在Activity中默认存在,可以在代码中设置其显示与否: ActionBar actionBa ...
- keil5破解
没有破解之前的keil只能编译限制大小的代码,72K好像我忘了?太长的话会报错. 注册机网址:http://bbs.armfly.com/read.php?tid=2346 1.在keil5左上角的F ...