How do i prevent the user from entering a negative number in C++

Hi, can someone give me an easy command that prevents a user from entering a negative value in the following code i made? thanks.

#include <iostream>

using namespace std;

int main()
{
   int X;
   int Y;
   cout<<"please enter the value of X and Y";
   cin>>X;
   cin>>Y;
   float result;
   result=4*X^3+Y^3-4;
   cout<<"the result of Z="<<result;
    return 0;
}