为何在 vc6 下通不过
大家看看,求平方根程序在dev-c++通过,却为何在vc6下通不过。#include <stdio.h>
#include <stdlib.h>
double kf(double x)
{
int i;
double z,y,d;
if(x<=0)return x;
z=x/2.0;i=0;
while(i<10000)
{
i++;
y=x/z;
d=y-z;
if(d<0)d=-d;
if(d<0.000000000000001)break;
z=(y+z)/2.0;
}
return y;
}
int main(int argc, char *argv[])
{
double w,x;
printf("x=");
scanf("%lf",&x);
w=kf(x);
printf("%16.16f\n",w);
system("pause");
return 0;
}