Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdint>
- #include <cstdio>
- #include <math.h>
- using namespace std;
- int main() {
- long double c;
- cin >> c;
- long double L = 0;
- long double R = abs(c);
- for (int i = 0; i < 200; ++i) {
- long double mid = L + (R - L) / 2;
- if (mid * mid + sqrt(mid) >= c) {
- R = mid;
- } else {
- L = mid;
- }
- }
- cout.precision(6);
- cout << R << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement