#include
void main()
{
int x;
float Y;
printf("please input x\n");
scanf("%d",&x);
if(x > 0)
Y = 1 + exp(x); //数学函数,计算e的x次方
else if(x == 0)
Y = 1;
else
Y = log(x * x); //数学函数,计算x的平方,以e为底
printf("%.4f\n",Y);
}
please input x
0
1.0000
Press any key to continue
please input x
1
3.7183
Press any key to continue
please input x
-2
1.3863
Press any key to continue