控制台 无输出 但是两个输入都正常

求助

```// 此程序求绝对值

float absolutevalue (float x)
{
if ( x < 0)
x = -x;

return x;

}

//此程序求squreRoot 中 while 循环次数

int times (float esplion){
int i;
while (esplion != 1) {
esplion *= 10;
i ++;
}
return i;
}

//此程序求平方根
float squreRoot (float x, float esplion)
{
float guess = 1.0;

while (absolutevalue (guess*guess - x) >= esplion )
    {
    int i;
     for ( i = 0; i<= times(esplion); i++)
 {  
     guess = (x/guess + guess)/2.0;
     printf ("The guess is %f.\n", guess);
 }
}

return guess; 

}

int main ()
{
printf ("Enter you number : \n");

float x, esplion ;  

scanf ("%f", &x);

printf ("Enter you esplion: \n");

scanf ("%f", &esplion);

printf ("The squreroot of the %f is %f", x, squreRoot (x, esplion));

return 0; 

}


squreRoot 效率很低,times(esplion)只需要调用一次
esplion取值不当的话,times方法的实现会导致死循环

times()函数好像死循环了。

图片说明图片说明图片说明

times()函数里写了个死循环,把times()函数里while的循环条件改一下

times方法有死循环了