问题描述
利用标准库中的cos(x)和fabs(x)函数实现arccos(x)函数,x取值范围是[-1, 1],返回值为[0, PI]。要求结果准确到小数点后5位。(PI = 3.1415926)
提示:要达到这种程度的精度需要使用double类型。
提示:要达到这种程度的精度需要使用double类型。
样例输入
0.5
样例输出

数据规模和约定
-1 <= x <= 1, 0 <= arccos(x) <= PI。
#include<stdio.h>
#include<math.h>
int main(){
double x,s;
scanf("%lf",&x);
s=acos(x);
printf("%.5lf",s);
return 0;
}