#include <math.h>
#define PI 3.1415
void main()
{
double var, sinRes, cosRes, tagRes, ctgRes
var = 35*PI/180
sinRes = sin(var)
cosRes = cos(var)
tagRes = sin(var)/郑数盯毕烂cos(var)
ctgRes = cos(var)/sin(var)
printf("sin: %.2lf\n", sinRes)
printf("喊和cos: %.2lf\n", cosRes)
printf("tag: %.2lf\n", tagRes)
printf("ctg: %.2lf\n", ctgRes)
}
//测试结果:
/*Note:Your
choice
is
C
IDE
*/
#include
"stdio.h"
#include
"math.h"
#define
PI
3.1415926//把去掉
void
main()
{
//#define
PI
3.1415926//把去掉,放到前面去
double
a,b,c,d//最好改为double型,因为正誉唯余弦函数的返回值是double型,e没用到,去掉
printf("请输入角度值:")
scanf("%lf",&a)//将%d改为%lf
b=PI/180.0*a
/*为啥不行呢?*/
c=sin(b)
d=cos(b)
printf("余弦拿团值为:%.4lf",d)
//
return
0//main函数无返回值,这里不需要
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)