Advertisement
Qpel

ciklai 3 užd

Mar 19th, 2017
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1.  
  2. /*Vardas Pavardë*/
  3. #include <iostream>
  4. #include <math.h>
  5. #include <cmath>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     bool t = 1;
  12.     int n = 1;
  13.     float a, b, e = 0.00001;
  14.     while(t)
  15.     {
  16.         a = (n+1)/((sqrt(pow(n+1,2)+1))*(sqrt(pow(n+1,2)-1)));
  17.         int g = n+1;
  18.         b = (g+1)/((sqrt(pow(g+1,2)+1))*(sqrt(pow(g+1,2)-1)));
  19.  
  20.         if(e>abs(b-a)){ cout << b; break;}
  21.         n++;
  22.     }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement