group:123,as
value:1,2,3,a,s
pname:123,123,123,as,as输出
1,a
1,s
2,a
2,s
3,a
3,s

解决方案 »

  1.   

    这个?            string str = "123,as";
                string[] ss = str.Split(',');            for (int i = 0; i < ss[0].Length; i++)
                {
                    for (int j = 0; j < ss[1].Length; j++)
                    {
                        Console.WriteLine(ss[0][i] + "," + ss[1][j]);
                    }
                }
      

  2.   

       string str = "123,as";
                string[] ss = str.Split(',');            for (int i = 0; i < ss[0].Length; i++)
                {
                    for (int j = 0; j < ss[1].Length; j++)
                    {
                        Console.WriteLine(ss[0][i] + "," + ss[1][j]);
                    }
                }
      

  3.   

    不知道怎么表达
    第一组是不固定的 只是个名字和第二组里的值没关系,
    也可能是:
    CSDN,ASP.NET
    1,2,3,a,s
    CSDN,CSDN,CSDN,ASP.NET,ASP.NET
    第三组数量上与第二组对应,值是标明属于哪组。
      

  4.   

    输出
    1,a
    1,s
    2,a
    2,s
    3,a
    3,s
    不懂
      

  5.   

    头大...

    数字组,字母组
    1,2,3,a,b
    数字组,数字组,数字组,字母组,字母组

    只是对第二组数据排列输出
    1,a
    1,b
    2,a
    2,b
    3,a
    3,b
      

  6.   

    WOCA 为了下载个资料 还要注册先赚积分 老子下完就走人!!
      

  7.   

    不是。
    123,as
    只是个假设数字组,字母组...
    1,2,3,a,b...
    数字组,数字组,数字组,字母组,字母组...
    都是不定项的
    行1和行2没有直接关系  行2数量和行3一一对应  行3值标识行2值所在行1的组
      

  8.   

    我认为已经说的比较清楚了啊
    已知
    数字组,字母组
    1,2,3,a,b
    数字组,数字组,数字组,字母组,字母组

    1,a
    1,b
    2,a
    2,b
    3,a
    3,b
      

  9.   

    老大,你这样表达很难看懂,你看我的:有两种动物:  马种  ,驴种
    混杂在一起了: 马A,马B,驴A,驴B,马B
    我们对应上面的顺序得出种类:马,马,驴,驴,马求交配生下骡子的方式.......
    马A :驴A
    马A :驴B
      

  10.   

    //解法:
    class 动物
    {
        public string 名称;
        public string 种类;
        public void 动物(string name,string type)
        {
           名称 = name;
           种类 = type;
        }
    }
    //原来的三个数组变两个了
    //for赋值不写了
    动物[i] = new 动物("马1","马");//再来个FOR比较注意,排列的话会有:"马1:驴1" 和 "驴1 :马1"的情况
    //应该考虑组合只要判断  动物[i].种类 是否相等即可
      

  11.   

    用麻烦的办法解决了还是谢谢LS各位List<List<string>> listGroup = new List<List<string>>();
    List<List<string>> datas = new List<List<string>>();string[] AttributeName = Request.Form["AttributeName"].Split(',');
            string[] AttributeValue = Request.Form["AttributeValue"].Split(',');
            string[] ParentName = Request.Form["ParentName"].Split(',');        for (int i = 0; i < AttributeName.Length; i++)
            {
                List<string> strList = new List<string>();
                string strAdd = string.Empty;
                for (int j = 0; j < AttributeValue.Length; j++)
                {
                    if(AttributeName[i]==ParentName[j])
                    {
                        strAdd = AttributeValue[j];
                        strList.Add(strAdd);
                    }
                }
                datas.Add(strList);
            }List<Model.Goods_Assemble> AssembleList = new List<Model.Goods_Assemble>();
            foreach (List<string> strTemp in listGroup)
            {
                Model.Goods_Assemble AssembleModel = new Model.Goods_Assemble();
                string strTime = DateTime.Now.ToString("hhmmssffff");
                AssembleModel.Number = "G" + strTime + ran.Next(1000, 9999).ToString();
                AssembleModel.Stock = Convert.ToInt32(DefaultStock.Text);
                string tempValue = string.Empty;
                foreach (string str in strTemp)
                {
                    tempValue += str + ",";
                }
                AssembleModel.AssembleValue = tempValue.TrimEnd(',');
                AssembleList.Add(AssembleModel);
     private void GetItem(int Index, List<string> Result)
        {
            if (Index > datas.Count - 1)
            {
                listGroup.Add(new List<string>(Result));
                return;
            }
            for (int i = 0; i < datas[Index].Count; i++)
            {
                Result.Add(datas[Index][i]);
                GetItem(Index + 1, Result);
                Result.RemoveAt(Result.Count - 1);
            }
        }        }