阅读背景:

编写程序计算分段函数

来源:互联网 

#include <stdio.h> 
#include <math.h>
#define PI 3.1415927
int main(){
	double x,ans,tmp1,tmp2;
	while(scanf("%lf",&x)!=EOF){
		if(x>0){
			tmp1 = sqrt(x)+exp(x);
			tmp2 = 5*x+5;
			ans = tmp1/tmp2;
		}
		else{
			ans = (2.0/3.0+sin(60*PI/180))*(-x);
		}
		printf("%f\n",ans);
	}
	return 0;
}#include <stdio.h> 
#include <math.h>
#de



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: