#include <stdio.h>
#include <math.h>
#define e 2.7182818
#define f(x) e^((3*x+5)/2)
main()
{
double n2x1 = 0.5773502, n2x2 = -0.5773502;
double n2w1 = 1, n2w2 = 1;
double n4x1 = 0.8611363, n4x2 = -0.8611363;
double n4x3 = 0.3399810, n4x4 = -0.3399810;
double n4w1 = 0.3478548, n4w2 = 0.3478548;
double n4w3 = 0.6521451, n4w4 = 0.6521451;
printf("n=2일 때 주어진 적분의 근삿값은 %lf이다. ", n2w1*f(n2x1) + n2w2*f(n2x2);
printf("n=2일 때 주어진 적분의 근삿값은 %lf이다. ", n4w1*f(n4x1) + n4w2*f(n4x2) + n4w3*f(n4x3) + n4w4*f(n4x4);
}
오류 : 식에 정수계열의 형식이 있어야합니다
ㅇㄴ
printf 괄호 안 닿음
닉값하네 ㄹㅇ
닫
닫아도 똑같음
C에서 ^는 power가 아닙니더 - 164260의 휘발성 계정
ㄴ 와우 #define f(x)pow(e,(3*x+5)/2)로 하니까 되네요 ! ㄳㄳ
와우!
담부터 오릴ㄹ 댄 신텍스를 쓰세요
이놈 닉값 하네ㅋㅋㅋㅋ