Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double l = 0;
- double r = 2;
- while ( r - l > 0.0000001 ) {
- double m = (l+r)/2;
- if ( m - cos(m) > 0 )
- r = m;
- else
- l = m;
- }
- cout << l << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement