源程序-分段计算水费0x<0# include<stdio.h>4xy= f(x)=0≤x≤15int main(void)31doublex, y;2.5x -10.5x>15printf("Enter x:");scanf("%lf",&x);Enter x: -0.5if (x< 0)f(-0.50) = 0.00y = 0;1Enter x: ?Enter x: 9.5else if (x <= 15)y= 4*x/3;f(9.50) = 12.671elsetEnter x: 21.3y= 2.5*x-10.5;1f(21.30) = 42.75printf("f(%.2f)=%.2fln",x, y);return 0;i1源程序-分段计算水费 # include <stdio.h> int main(void) { double x, y; printf("Enter x:"); scanf("%lf", &x); if (x < 0){ y = 0; } else if (x <= 15){ y = 4 * x / 3; } else{ y = 2.5 * x - 10.5; } printf("f(%.2f) = %.2f\n", x, y); return 0; } Enter x: -0.5 f(-0.50) = 0.00 Enter x: 9.5 f(9.50) = 12.67 Enter x: 21.3 f(21.30) = 42.75 0 0 4 ( ) 0 15 3 2.5 10.5 15 x x y f x x x x = = − Enter x: ?