110,567
社区成员
发帖
与我相关
我的任务
分享
private ArrayList Split(object[] obj , int N)
{
ArrayList Outer= new ArrayList();
int length = obj.Length + 1;
//设定取值范围N至obj.Length
for(int i = N ; i < length ; i ++)
{
//从第j个元素开始取值
for(int j = 0 ; j < length - i ; j ++)
{
ArrayList list = new ArrayList();
//取数量为i的元素
for(int k = 0 ; k < i ; k ++)
{
list.Add(obj[k+j]);
}
Outer.Add(list);
}
}
return Outer;
}
1、int[DestCount] counter;
string[DestCount] dest;
2、String.Split();
3、for(int i=0; i<subCount; ++i)
{
for(int j=0; j<DestCount; ++j)
{
if(dest[j].Contains(sub[i]))
{
++counter[j];
}
}
}
int matchCount; //user input
4、for(int i=0; i<DestCount; ++i)
{
if(counter[i] >= matchCount)
{
output dest[i];
}
}