3 条题解
- 1
信息
- ID
- 205
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 2
- 标签
- 递交数
- 61
- 已通过
- 40
- 上传者
#include <bits/stdc++.h> using namespace std;
int main() { double x, n, s = 1.0; cin >> x >> n; for (int i = 1; i <= n; i++) { s = (s + x / s) / 2; } cout << fixed << setprecision(3) << s; return 0; }
#include <bits/stdc++.h>
using namespace std; int a[25005], b[25005];
int main() { double x, n, a = 1.0; cin >> x >> n; for (int i = 1; i <= n; i++) { a = (a + x / a) / 2; }
cout << fixed << setprecision(3) << a;
return 0;
}