用c语言程序写出,输入一个角度值,计算正弦余弦,/* Note:Your choice is C IDE */#include "stdio.h"#include "math.h"void main(){#define PI 3.1415926;float a,b,c,d,e;printf("请输入角度值:");scanf("%d",&a);b=PI/180.0*a; /*为啥
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 23:05:26
用c语言程序写出,输入一个角度值,计算正弦余弦,/* Note:Your choice is C IDE */#include "stdio.h"#include "math.h"void main(){#define PI 3.1415926;float a,b,c,d,e;printf("请输入角度值:");scanf("%d",&a);b=PI/180.0*a; /*为啥
用c语言程序写出,输入一个角度值,计算正弦余弦,
/* Note:Your choice is C IDE */
#include "stdio.h"
#include "math.h"
void main()
{
#define PI 3.1415926;
float a,b,c,d,e;
printf("请输入角度值:");
scanf("%d",&a);
b=PI/180.0*a; /*为啥不行呢?*/
c=sin(b);
d=cos(b);
printf("正弦值为:%.4f\n",c);
printf("余弦值为:%.4f",d);
return 0;
}
用c语言程序写出,输入一个角度值,计算正弦余弦,/* Note:Your choice is C IDE */#include "stdio.h"#include "math.h"void main(){#define PI 3.1415926;float a,b,c,d,e;printf("请输入角度值:");scanf("%d",&a);b=PI/180.0*a; /*为啥
/* 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\n",c);
printf("余弦值为:%.4lf",d);
// return 0;//main函数无返回值,这里不需要
}