使用exp和pow表示函数的运算形式,方便进行书写
#include <stdio.h>
#include <math.h>
int main() {
float x;
printf("x=");
scanf("%f",&x);
if(x >= 0 && x<= 1)
printf("y=%g",exp(x));
else
printf("y=%g",pow(x,2)-1);
return 0;
}
使用exp和pow表示函数的运算形式,方便进行书写
#include <stdio.h>
#include <math.h>
int main() {
float x;
printf("x=");
scanf("%f",&x);
if(x >= 0 && x<= 1)
printf("y=%g",exp(x));
else
printf("y=%g",pow(x,2)-1);
return 0;
}