儿童学画(2)# Parenting - 为人父母
a*r
1 楼
complete a function as follows:
int getClosest(int x)
{
}
The output must be smaller than the input integer but closest to the input
integer AND the output integer and the input integer must contain same 1's.
For example, if the input is 5, it binary representation is 0101, so the
answer will be 0011 (it is 3) because 3 < 5 and both have two 1's
int getClosest(int x)
{
}
The output must be smaller than the input integer but closest to the input
integer AND the output integer and the input integer must contain same 1's.
For example, if the input is 5, it binary representation is 0101, so the
answer will be 0011 (it is 3) because 3 < 5 and both have two 1's