C语言 分段函数if else语句

#include <stdio.h>
int main()
{
    double x,y;
    printf("Enter x (x>=0)
");
    scanf("%lf",&x);
    if (x<=15){y=4*x/3;}
    else{y=2.5*x-10.5;}
    printf("y=f(%f)=%.2f
",x,y);
}
原文地址:https://www.cnblogs.com/httpwwwachangcom/p/9453336.html