Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- #include<iomanip>
- using namespace std;
- double f(double x)
- {
- }
- double fprim(double x)
- {
- }
- void fi(double x, double eps)
- {
- int k=0;
- double h;
- do
- {
- h = //wynik funkcji
- x +=h;
- cout<<setprecision(15)<<endl<<x<<endl;
- k++;
- }
- while(fabs(h)>=eps);
- cout<<setprecision(15)<<"x "<<x<<" k "<<k<<endl;
- }
- int main()
- {
- int n;
- cin>>n;
- double eps = pow(10,-n);
- fi(-2,eps);
- cout<<"\n-------------------------\n";
- // fi2(1,eps);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement