Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long double c;
- cin >> c;
- long double low = 0;
- long double high = 1e5;
- for(int i = 0; i < 40; i ++)
- {
- long double middle = (low + high) / 2;
- if(middle * middle + sqrt(middle) < c)
- {
- low = middle;
- }
- else
- {
- high = middle;
- }
- }
- cout.precision(9);
- cout << fixed << high << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement