第三章例3-4

#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;
}

 

posted @ 2013-10-02 18:30  huangsilinlana  阅读(113)  评论(0)    收藏  举报