Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include<iostream>
  2. #include<math.h>
  3. #include<iomanip>
  4. using namespace std;
  5.  
  6.  
  7.  
  8. double f(double x)
  9. {
  10.  
  11. }
  12. double fprim(double x)
  13. {
  14.  
  15. }
  16.  
  17.  
  18. void fi(double x, double eps)
  19. {
  20.  
  21.     int k=0;
  22.     double h;
  23.  
  24.  
  25.      do
  26.     {
  27.  
  28.  
  29.         h = //wynik funkcji
  30.  
  31.         x +=h;
  32.         cout<<setprecision(15)<<endl<<x<<endl;
  33.         k++;
  34.    }
  35.     while(fabs(h)>=eps);
  36.  
  37.     cout<<setprecision(15)<<"x "<<x<<" k "<<k<<endl;
  38. }
  39.  
  40. int main()
  41. {
  42. int n;
  43. cin>>n;
  44.     double eps = pow(10,-n);
  45.  
  46.    fi(-2,eps);
  47.  
  48.    cout<<"\n-------------------------\n";
  49.   // fi2(1,eps);
  50.  
  51.     return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement