#include<iostream>
#include<cmath>
#include "iomanip"
using namespace std;
int main(){
float x0,x1,a;
cout<<"输入一个正数:"<<endl;
cin>>a;
if(a<0)
cout<<a<<"不能开平方!"<<endl;
else {
//有实数解的情况
x1=a/2;
//x1用作保存结果
do {
x0=x1;
x1=(x0+a/x0)/2;
} while (fabs(x1-x0)>=1e-5);
cout <<setiosflags(ios::fixed)<<setprecision(3)<<x1;
}
return 0;
}