以数字33188为例
string temp;
string::iterator it = temp.begin();int i;
for ( i= 0; i < 9; i++)
{
if (( 33188 >> i) & 0x1 )
{
if (0 == i % 2)
{
temp.insert(it, 1, 'r');
}
else if ( 1 == i % 2)
{
temp.insert(it, 1, 'w');
}
else if ( 2 == i % 2)
{
temp.insert(it, 1, 'x');
}
}
else
{
temp.insert(it, 1, '-');
}
}
cout<<temp<<endl;