习题2-7 近似计算
来源:互联网 发布:java 数据字典设计 编辑:程序博客网 时间:2024/05/22 14:28
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double m=0.0;
for(int i=1;;i++)
{
m+=1.0/i*pow(-1,i+1);
if(1.0/i<0.000001)
break;
}
cout<<m<<endl;
return 0;
}
#include<cmath>
using namespace std;
int main()
{
double m=0.0;
for(int i=1;;i++)
{
m+=1.0/i*pow(-1,i+1);
if(1.0/i<0.000001)
break;
}
cout<<m<<endl;
return 0;
}
- 习题2-7,近似计算
- 习题2-7 近似计算
- 《算法竞赛入门经典》习题2-7 近似计算(approximation)
- 算法竞赛入门经典 习题2-7 近似计算(opproximation)
- 2-7近似计算pi
- 习题 2-1 位数 2-2 水仙花数 2-3 韩信点兵 2-4倒三角形 2-6 调和级数 2-7近似计算 2-8 子序列的和
- 算法竞赛入门经典2-7近似计算
- 近似计算
- 近似计算
- 近似计算
- 近似计算
- 近似计算(approximation)
- 1119 -- 近似计算
- 计算平方根近似法
- c++近似计算概率
- 字符串近似匹配计算
- 1296: 近似计算
- 近似计算(approximation)
- gdal库的三个使用心得
- c++基础(枚举)
- BOM对象
- toj3095 Best Compression Ever 不懂 求解释?
- Solaris 使用ndd指令设置网卡速率
- 习题2-7 近似计算
- C/C++/JAVA/语法大PK——访问控制
- 从solaris explorer鉴别DISK 硬件故障识别方法
- ios 中生成随机数
- What is a "sosreport" and how do I create it in Red Hat Enterprise Linux 4.6 and later
- 基于移动终端(平板电脑、手机)的网络调查
- struct sizeof
- How to interpret the meanings of HDD LEDs
- 图像分割方法