#include<stdio.h>
#include<math.h>
void fir(double x);
void scd(double x);
int main()
{
float x;//这里能换成 double x 吗?为什么
scanf("%f",&x);
if(x>=0)
fir(x);
else
scd(x);
return 0;
}
void fir(double x){
double b;
b=sqrt(x);
printf("f(%.2f)=%.2f",x,b);
}
void scd(double x){
double b;
b=pow(x+1,2);
printf("f(%.2f)=%.2f",x,b);
}
WrongAnswer
相关分类