在C的math.h是有专门的三角函数和反三角函数的。
所以
你这个
x=asin(0.5)
输出
cos(x)
和
tan(x)就可以了。
追问能不能具体点?
追答#include <stdio.h>
#include <math.h>
int main()
{
double x;
x = asin(0.5);
printf("cos= %lf tan = %lf\n", cos(x), tan(x));
return 0;
}
追问那如果我想限定一下小数点后面位数,该怎么修改?
追答比如限定两位
用%.2lf
三位 用%.3lf
追问好的,谢谢你了。