解题思路:
由于C语言自带开方函数,所以输出的时候直接转换就可以了
注意事项:
sqrt函数在math.h的头文件中,所以使用sqrt就需要调用math头文件
参考代码:
#include<stdio.h>
#include<math.h>
int main(void)
{
double x;
scanf("%lf",&x);
printf("%.3lf",sqrt(x)); //输出的时候调用sqrt函数
return 0;
}
0.0分
0 人评分