//고대로 올린거임..
#include <stdafx.h>
#include <stdio.h>
#include <math.h>
float eval_f(float x); /* evaluation of f(x) */
void main()
{ float xl, xm, xh, e, delta;
int i=0;
printf("\nType left bound of the interval : ");
scanf("%f",&xl);
printf("\nType right bound of the interval : ");
scanf("%f",&xh);
printf("\nType acceptible error interval : ");
scanf("%f",&e);
printf("\n");
do{ xm = (xl + xh) /2.0;
printf("%3dth Iteration Root : %f < with error %f >\n", ++i, (xl+xh)/2.0, (xh-xl)/2.0);
if (eval_f(xl) * eval_f(xm) == 0.0 )
break;
else if ( eval_f(xl)*eval_f(xm) < 0.0 )
xh = xm;
else if ( eval_f(xm)*eval_f(xh) < 0.0 )
xl = xm;
else { printf(" \nSomething Wrong ! \n");
break;
}
} while(xh - xl > e);
}
float eval_f(float x)
{ float y;
y = log( x + 5.0 ) + x;
return(y);
}
악 n 앞에 \\ 사라졌네.. 그건 알아서 붙여
컴파일한 exe파일올려달라는거아니엿냐 ㅋㅋ
오 땡큐 함 해볼겡ㅋㅋㅋ
ㄴ \\ 안써지는데? ㄷㄷ; 프로그램안에서 쓰면 /로 쓰여 이거 왜이래?
폰트차이임
폰트 차이임.. 엔터키위에있는 \\ 입력하세요
ㄴ 감사요 ㅋㅋ
warning C4244: \'=\' : conversion from \'double\' to \'float\', possible loss of data warning C4244: \'=\' : conversion from \'double\' to \'float\', possible loss of data
error C4996: \'scanf\': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS
으아아아아앙 시발 나 그냥 책 태우고올게
말그대로 scanf 를 scanf_s 로 바꾸시고.. 워닝은 무시하시고..
나도 테스트해봣으나 컴파일잘만되네 #include <stdafx.h>지우고 vs2008
오 된다 ㅋㅋㅋㅋ 형들 진짜 고마워 ㅋㅋㅋㅋㅋㅋㅋㅋㅋ