永发信息网

c语言 输入一个度数x 求弧度 sin x cos x tan x cot x

答案:2  悬赏:80  手机版
解决时间 2021-04-05 19:46
  • 提问者网友:我们很暧昧
  • 2021-04-04 21:25
c语言 输入一个度数x 求弧度 sin x cos x tan x cot x
最佳答案
  • 五星知识达人网友:杯酒困英雄
  • 2021-04-04 21:44
cot x 指的是不是 cotangent x ?

#include
#include
main()
{
float a;
printf("input the angle= ");
scanf("%f",&a);
printf("the rad = %f\n",a/=360.0);
printf("sinx=%f, cosx=%f, tanx=%f, cotx=%f\n",sin(a),cos(a),tan(a),1/tan(a));
}追问谢谢啊
#include
#include
#define P 3.1415926
main(void)
{
double a,b,c,d,e,f;
printf("Please input a degree:x=");
scanf("%lf",&b);
b=P/180.0*b;
printf("sadin=%.4lf\n",b);
a=sin(b);
printf("sin x=%.4lf\n",a);
c=cos(b);
printf("cos x=%.4lf\n",c);
d=tan(b);
printf("tan x=%.4lf\n",d);
e=1/d;
printf("cot x=%.4lf\n",e);
system("pause");
return 0;
}
 我这样做 可以吗追答抱歉楼主,我的是错的(算弧度的时候少乘了2PI,糊涂了),你的程序对。
仅仅建议你不用 system("pause") 用getchar();更好追问请问 怎么用c 编写 等比数列的数列和Sn 和 通项公式啊
main()
{
int a,q,n,s=0;
printf("please input tha data:\na1=");
scanf("%d",&a);
printf("\nq=");
scanf("%d",&q);
printf("\Snn=");
scanf("%d",&n);
while(n--)
{
s+=a;
a*=q;
}
printf("s=%d\n",s);
system("pause");
return 0;
}Sn我会了 通项公式 怎么弄啊
全部回答
  • 1楼网友:低音帝王
  • 2021-04-04 23:06
cosx=1/2,由常见角度的正余弦直接可得x=2kπ±π/3
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯