The problem has been solved. I used string stream.
...
...
do
{
int x;
string xstr;
std::cout << "Enter number: ";
std::getline(std::cin, xstr);
std::stringstream(xstr) >> x;
if (x == 1)
std::cout "...";
else if (x == 2)
std::cout "...";
else if (x == 3)
std::cout "...";
else
std::cout "...";}
while (x < 1 || x > 3);
{
x++;
}
And it works now good even you enter a char type. And need don't forget includes...:D