Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- #include <iomanip>
- #include <vector>
- using namespace std;
- int main() { int x, f, xn, xk, dx, i, d, z;
- double a, b , c , F;
- cout « "ENTER a" « endl;
- cin » a;
- cout « "ENTER b" « endl;
- cin » b;
- cout « "ENTER c" « endl;
- cin » c;
- cout « "ENTER x" « endl;
- cin » x;
- cout « "ENTER xn" « endl;
- cin » xn;
- cout « "ENTER xk" « endl;
- cin » xk;
- cout « "ENTER dx" « endl;
- cin » dx;
- d = abs((xk+1)-xn);
- z = dx;
- vector <int> m(d);
- for (i = 1; i <= d; i++) { m[i] = xn; xn++;}
- if ((a*(b+c))==0)
- {for (i = 1; i <= d; i += z) { if (c < 0 and b!= 0) {f = a * (pow(m[i],2)) + (pow(b,2)) * m[i];}
- else if (c > 0 and b == 0) {f = ((m[i]+a)/(m[i]+c));}
- else {f=(m[i]/c);}
- cout « setw(10) « "|" « "f=" « f « endl;};}
- if ((a*(b+c))!=0)
- {for (i = 1; i <= d; i += z ) { if (c < 0 and b!= 0) {F = a * (pow(m[i],2)) + (pow(b,2)) * m[i];}
- else if (c > 0 and b == 0) {F = ((m[i]+a)/(m[i]+c));}
- else {F=(m[i]/c);}
- cout « setw(10) « "|" « "F=" « F « endl;};};}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement