c语言,编程正弦(0,π)与x轴的面积的近视值
答案:1 悬赏:20 手机版
解决时间 2021-11-27 11:58
- 提问者网友:轮囘Li巡影
- 2021-11-26 19:50
c语言,编程正弦(0,π)与x轴的面积的近视值
最佳答案
- 五星知识达人网友:狂恋
- 2021-11-26 20:54
#include "stdio.h"
#include "math.h"
int main(void){
double x,d=1.0e-7,s;
for(s=x=0.0;x<=3.1415926;s+=d*sin(x),x+=d);
printf("Covers an area of about %g
",s);
return 0;
}或
#include "stdio.h"
#include "math.h"
int main(void){
printf("Covers an area of about %g
",-(cos(3.1416926)-cos(0)));
return 0;
}
#include "math.h"
int main(void){
double x,d=1.0e-7,s;
for(s=x=0.0;x<=3.1415926;s+=d*sin(x),x+=d);
printf("Covers an area of about %g
",s);
return 0;
}或
#include "stdio.h"
#include "math.h"
int main(void){
printf("Covers an area of about %g
",-(cos(3.1416926)-cos(0)));
return 0;
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯