如题所述
#include <stdio.h>
#include <math.h>
int main()
{
double x,y;
printf("Input x:");
scanf("%lf",&x);
if(x<=1){
y=pow(2.718281828,x);
}else{
y=x*x-1;
}
printf("y=%lf\n",y);
return 0;
}追问
#include <math.h>
int main()
{
double x,y;
printf("Input x:");
scanf("%lf",&x);
if(x<=1){
y=pow(2.718281828,x);
}else{
y=x*x-1;
}
printf("y=%lf\n",y);
return 0;
}追问
谢谢🙏
温馨提示:答案为网友推荐,仅供参考
第1个回答 2016-10-27
#include<stdio.h>
#include<math.h>
void main() { double x,y;
scanf("%lf",&x);
if ( x<=1 ) y=exp(x);
else y=x*x-1;
printf("%lf\n",y);
}
#include<math.h>
void main() { double x,y;
scanf("%lf",&x);
if ( x<=1 ) y=exp(x);
else y=x*x-1;
printf("%lf\n",y);
}