级数求和
来源:互联网 发布:我的世界0.15.0暮色js 编辑:程序博客网 时间:2024/09/21 09:21
include
using namespace std;
int main()
{
double k;
int n=0;
double sn=0; //使用double精度
cin>>k;
while (sn<=k) //知道不满足跳出
{
n++;
sn+=1.0/n; //是+= 先加后等于!
}cout<<n;return 0; //不要漏掉
}
0 0
- 级数求和
- 级数求和
- 级数求和
- 级数求和
- 级数求和
- 级数求和
- 级数求和
- 级数求和
- 【wikioi】1007 级数求和
- Vijos P1127 级数求和
- 【洛谷】P1035 级数求和
- 平方和级数求和
- codevs 1007 【级数求和】
- 洛谷P1035 级数求和
- [noip2002pj] 级数求和
- 1007 级数求和
- 【codevs 1007】级数求和
- P1035 级数求和
- 子元素选择器
- 使用Zeromq和protobuf实现的socket通信
- BitMap(位图)结构的C++实现
- 奇妙的异或
- git基本常用命令
- 级数求和
- redis实战-数据安全与性能保障
- [Leetcode] #128 Longest Consecutive Sequence
- 隐式锁 Synchronized 与显示锁 Lock的用法和简单对比
- C语言文件读写
- linux任务调度命令crontab
- C++ const关键字
- Js删除前确认操作
- 后代选择器和子元素选择器