急求关于三角函数的问题
制作一个函数表实现以下内容0<=x<=3.1415926
实现以下结果 :
x sin(x) cos(x) tan(x) exp(x)
0.000000 0.000000 1.000000 0.000000 1.000000
0.157080 0.156435 0.987688 0.158385 1.170089
0.314160 0.309018 0.951056 0.324921 1.369109
0.471240 0.453991 0.891006 0.509527 1.601979
0.628320 0.587786 0.809016 0.726545 1.874459
0.785400 0.707108 0.707105 1.000004 2.193284
0.942480 0.809018 0.587783 1.376383 2.566338
我只能一次实现一个 全部的做不出来
#include <stdio.h>
#include <math.h>
int main(void)
{
double result, x = 0.000000;
result = sin(x);
result = cos(x);
result = tan(x);
printf("The sin() of %lf is %lf\n", x, result);
printf("The cosine of %lf is %lf\n", x, result);
printf("The tan of %lf is %lf\n", x, result);
return 0;
}
请教各位了 谢谢了
----------------解决方案--------------------------------------------------------
不错嘛
----------------解决方案--------------------------------------------------------
#include"math.h"
main()
{float x;
for(x=0;x<=3.1415926;x=x+0.157080)
printf("%f %f %f %f %f\n",x,sin(x),cos(x),tan(x),exp(x));
}
看人家小姑娘做的.......
----------------解决方案--------------------------------------------------------
#include"math.h"
main()
{float x;
for(x=0;x<1;x=x+0.157080)
printf("%f %f %f %f %f\n",x,sin(x),cos(x),tan(x),exp(x));
}
----------------解决方案--------------------------------------------------------
sin(x),cos(x),tan(x),exp(x)[em09]
----------------解决方案--------------------------------------------------------