Hopefully this isn't homework, because this is the solution (it's in C#, though you should be able to convert it to C++ fairly easily):
List<uint> nums = new List<uint>();
nums.Add(Convert.ToUInt32("10100010", 2));
nums.Add(Convert.ToUInt32("00101001", 2));
nums.Add(Convert.ToUInt32("10101000", 2));
nums.Add(Convert.ToUInt32("00100001", 2));
nums.Add(Convert.ToUInt32("10000101", 2));
int minMatches = 4;
bool success = false;
int count;
int lastBit = (int)Math.Log(Int32.MaxValue, 2);
for (int i = 0; i <= lastBit; i++)
{
count = 0;
for (int j = 0; j < nums.Count; j++)
{
if (((((uint)1) << i) & nums[j]) != 0)
{
count++;
}
}
if (count >= minMatches)
{
success = true;
break;
}
}
if (success)
{
string msg = "There were at least {0} numbers that had at least one common set bit.";
MessageBox.Show(string.Format(msg, minMatches.ToString()));
}