Va rog sa transformati din pseudocod in c++

#inlcude <iostream>
using namespace std;
int main()
{
int n,m=0,x=1,cp;
cin>>n;
while (n<=9)
{
cp=n;
while (cp!=0)
{
if (cp%10==x)
m=m*10+x;
cp=cp/10;
}
x=x+1;
}
cout<<m;
return 0;
}