编程.用牛顿方法计算浮点数的平方根.请纠错
# include <stdio.h># include <stdlib.h>
# include <math.h>
int main ()
{
double x,y,z,t;
printf("Enter a positive number:");
scanf("%lf",&x);
y=1;
do {
z=x/y;
t=(y+(x/y))/2; //平均數
if ( fabs(y-t)>0.0001*y)
y=t;
} while ( fabs(y-t)>0.0001*y);
printf("Square root:%f",y);
system("pause");
return 0;
}
运行不出来,哪里错了