#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);}
- 3 回答
- 0 关注
- 1973 浏览
添加回答
举报
0/150
提交
取消