#include<iostream>
#include<cmath>
#include<string>
using namespace std;
class Mistake
{
string str;
public:
Mistake() :str("the number should be positive") {};
void show()
{
cout << str << endl;
}
};
void getsqrt(double x)
{
Mistake a;
if (x < 0)
throw a;
cout << sqrt(x) << endl;
}
int main()
{
double x;
while (1)
{
cout << "x=";
cin >> x;
try
{
getsqrt(x);
}
catch (Mistake a)
{
a.show();
}
}
}