有3个字符型数据,长度分别为4,3,5
现在他们之间任意组合.会出现多少种组合?例如:str[0],str1[1],str2[0]
str[1]
str2[3]
str[1],str1[2],str2[2]
str[0],str1[1]..............等等最好能有代码.谢谢!
现在他们之间任意组合.会出现多少种组合?例如:str[0],str1[1],str2[0]
str[1]
str2[3]
str[1],str1[2],str2[2]
str[0],str1[1]..............等等最好能有代码.谢谢!
string[] str1={"1","2","3","4"};
string[] str2={"1","2","3","4","5"}; int count=0; for (int i=0;i<str.Length;i++)
{
for(int k=0;k<str1.Length;k++)
{
for (int j=0;j<str2.Length;j++)
{
Response.Write(str[i]+" "+str1[k]+" "+str2[j]+"<br>"); count++;
}
}
} Response.Write("共"+count+"条记录");