double fun(double x) { if(x>0) return (x+1)/2; else if(x==0) return 0.568; return x*x/2; }
直接用if else判断呀 然后返回对应的值。
if(x>0)
return ...