c++问题,求解答,大一新生

img

#include <stdio.h>
#include<iostream>
#include <math.h>
int   main()
{
    float a;     
    float x0, x1;
   printf("Input a positive number:\n");
    scanf("%f", &a);
    x0 = a / 2;  
    x1 = (x0 + a / x0) / 2;
    while (fabs(x1 - x0) >= 1e-5)
    {
       x0 = x1;
       x1 = (x0 + a / x0) / 2;
    }
    printf("The square root of %5.2f is %8.5f\n", a, x1);
    system("pause");
    return 0;
}

img


有用望采纳!