#include <cstdio> #include <cmath> int main() { double x; scanf("%lf", &x); double l = -10000, r = 10000; while (r - l > 1e-8) { double mid = (l + r) / 2; if (mid * mid * mid > x) r = mid; else l = mid; } printf("%.6f\n", l); return 0; }
2023-11-10 10:06:28
#include <cstdio> #include <cmath> int main() { double x; scanf("%lf", &x); double l = -10000, r = 10000; while (r - l > 1e-8) { double mid = (l + r) / 2; if (mid * mid * mid > x) r = mid; else l = mid; } printf("%.6f\n", l); return 0; }
下一篇:Keepalived 安装