Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. double l = 0;
  8. double r = 2;
  9.  
  10. while ( r - l > 0.0000001 ) {
  11. double m = (l+r)/2;
  12. if ( m - cos(m) > 0 )
  13. r = m;
  14. else
  15. l = m;
  16. }
  17. cout << l << endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement