日期:2014-05-17 浏览次数:20803 次
using System;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string str = "01 02 03 04 05 06 07 08";
string[] set = str.Split(' ');
int n = set.Length;
int m = 6;
int min = (0x01 << m) - 1;//00111111
int max = min << (n - m);//11111100
int j;
int k;
for (int i = min; i <= max; i++)
{
j = 0;
k = i;
while (k>0)
{
j += (int)(k & 0x01);
k >>= 1;
if (j > m)
{
break;
}
}
if (j == m)
{
k = 0x01;
for (int l = n-1; l>=0; l--)
{
&