Using the pointer to the function as the function parameter, find the piecewise function. When x < 0, y = x + 2; when 0 ≤ x < 5, y = 3x-1; when x ≥ 5, y = x (x-1)

Using the pointer to the function as the function parameter, find the piecewise function. When x < 0, y = x + 2; when 0 ≤ x < 5, y = 3x-1; when x ≥ 5, y = x (x-1)


Double fun1 (double x) {return x + 2;} double fun2 (double x) {return 3 * X-1;} double fun3 (double x) {return x * (x-1);} void main() {double x; scanf (% lf ", & x); double (* fun) (double); / / function pointer if (x)



According to the image of the linear function y = - 3x + 6, when the function value is greater than 0
X value range


Let - 3x + 6 > 0 be solved, but pay attention to the number of domains in the question, and take the intersection according to the domain



The opening direction of the function y = 3x ^ 2 + X-2 is pointed out, and the value range of X is obtained when y ≥ 0


The coefficient 3 is greater than 0
So open your mouth up
y=3x²+x-2=0
(3x-2)(x+1)=0
So the abscissa of the point of intersection with the X axis is 2 / 3 and - 1
Draw a sketch
x≤-1,x≥2/3