프로그래밍 언어 project
페이지 정보
작성일 19-06-17 15:41
본문
Download : 프로그래밍 언어 과제(2).hwp
프로그래밍 언어 project
_hwp_01.gif)
_hwp_02.gif)
레포트/공학기술
#include ` stdio.h `
#include ` math.h `
double f(double x)
{
return(xxx);
}
int main()
{
int i, n;
double a, b, h, s0, s1, s2, s, x;
printf(`Input a= `);
scanf(`%lf`, &a);
printf(`Input b= `);
scanf(`%lf`, &b);
printf(`Input n= `);
scanf(`%d`, &n);
h = (b-a)/(2.0n);
printf(`h= %lfn`,h);
s0 = f(a) + f(b);
s1 = 0;
s2 = 0;
printf(`n`);
for(i = 1; i `= 2n-1; i++)
{
x = a+hi;
if(i % 2 0)
{
s2 = s2 + f(x);
}
else
{
s1 = s1 + f(x);
}
}
s = h(s0+4.0s1+2s2)/3.0;
printf(`y0 = %6.4lfn`, f(a));
for(i=1;i`2n-1;i++)
{
x=a+hi;
if(i%2 0) printf(`y%d = %6.4lfn`, i/2, f(x));
}
printf(`y%d = %6.4fn`, n, f(b));
printf(`n [%4.2lf ,%4.2lf]`,a, b);
printf(`n Integral f(x)dx = %lf`, s);
printf(`n`);
retu…(drop)
설명
프로그래밍 언어 project
순서
프로그래밍 언어 과제 , 프로그래밍 언어 과제공학기술레포트 , 프로그래밍 언어
Download : 프로그래밍 언어 과제(2).hwp( 68 )
프로그래밍,언어,공학기술,레포트
다.