/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 求非负整数 n 的平方根
 * @param n int整型 你需要求 n 的平方根
 * @return double浮点型
 */
double findSqrt(int n ) 
{
    // write code here
    //使用牛顿迭代法求解
    double x=(double)n;
    double new_x;
    if(n==0)
    {
        return 0.00000000000;
    }
    else 
    {
        while(1)
        {
            new_x=0.5*(x+(double)n/x);
            if (fabs(new_x - x) < 1e-5) 
            {
                break;
            }
            x=new_x;
        }
    }
    return new_x; 
}