积分计算//大神,帮我看看哪里有问题!

//---------------------------------------
//f(x)=1/x在区间(1,a)的积分
//---------------------------------------
#include
#include
#include
using namespace std;
double g(double x){
return 1/x;
}
double rec(double a,double b,double (*f)(double) ){
double c=b-a;
double oldtime=c*(f(a)+f(b))/2;
double newtime=0;
for (int n=1;abs(oldtime-newtime)>=1e-4;n*=2)
{
newtime=oldtime;

oldtime=0;
for (int i=1;i<=n;++i)
{
oldtime+=f(a+i*(b-a)/n);
}
oldtime+=(c/n)*((f(a)+f(b))/2);
}
return oldtime;
}
int main(){
ifstream in("C:/Users/hello/Desktop/adc_0604.txt");
for(double b;in>>b;)
{
cout<<((b>1)?rec(1,b,g):rec(b,1,g))<<'\n';
}
}

http://blog.csdn.net/the_king_cloud/article/details/7641816
http://download.csdn.net/download/zhizhuodjp/1187646
http://wenku.baidu.com/link?url=FMBIIUM6A3ZIakON_xYb3J7kra9hZwnxTZYNG_G6Ok8MsFwlc6YZ3TY7OR8DU5J2GzgvXmmOcfXNekoWOD4tKofKZgbLzABZnJAIvlUM3ZO
http://zhidao.baidu.com/link?url=OLNBklETQ3OXsJtQm90ozlUPyTVESllO3m2U1Fei8ImCsgiTCN_9nSP1uYWN0ThfMv9LkDK-as3D2OPzVRYYUq

这都是什么 乱码了吗