#include <stdio.h>
#include <math.h>
int main() {
double x = 0.5;
double result = acos(x);
printf("acos(0.5) = %f\n", result);
return 0;
}
#include <stdio.h>
#include <math.h>
int main() {
double angle = 45; // 角度值
double x = cos(angle * M_PI / 180); // 將角度轉換為弧度
double result = acos(x); // 計算反余弦值
printf("The arccosine of %f is %f degrees\n", x, result * 180 / M_PI); // 將弧度值轉換為角度值輸出
return 0;
}