Ну типа эээ Code: int func(int a, int b,int c) { // ввод с клавы int x_start = 0; int x_end = 100; int dx = 1; const char format[]="%d: %d\n"; for(int x=x_start;x<x_end;x+=dx) { if(a<0 && c !=0) printf(format,x, (a*(x*x))+b*x+c)); else if(a>0 && c == 0) printf(format,x,((a * -1)/x-c)); else printf(format,x,(a*(x+c))); } return (a & (b | c)) != 0 ? действительное значение : целое значение; }
>ASK.FM Code: #include <iostream> #include <math.h> using namespace std; #define EPSILON 1e-8 int main() { int ai, bi, ci, isInt; double a, b, c, x, y, xend, dx; //----------------------------------do input cout << "Enter a: "; cin >> a; cout << "Enter b: "; cin >> b; cout << "Enter c: "; cin >> c; cout << "Enter x: "; cin >> x; cout << "Enter xend: "; cin >> xend; cout << "Enter dx: "; cin >> dx; if(((x > xend) && (dx > 0)) || ((x < xend) && (dx < 0))) { cout << "Error: Invalid increment value"; return -1; } //----------------------------------intpart only, if !(a && (b || c)) isInt = 1; for(ai = a, bi = b, ci = c; ;) { if(ai % 10 && (bi %10 || ci % 10)) { isInt = 0; break; } ai /= 10; bi /= 10; ci /= 10; if(!ai && !bi && !ci) break; } //----------------------------------print y=F(a,b,c,x) for( ; x < xend; x += dx) { if(isInt) modf(x, &x); if(a < 0 && abs(c) > EPSILON) y = a * x * x + b * x + c; else if(a > 0 && abs(c) < EPSILON) y = -a / (x - c); else y = (x + c) * a; printf("x = %f, y = %f\n", x, y); } return 0; }