【发布时间】:2015-01-08 15:32:48
【问题描述】:
List<string> list = new List<string>();
list.Add("A");
list.Add("B");
List<string> list1 = new List<string>();
list.Add("a");
list.Add("b");
for (int i = 0; i < list.Count; i++)
{
// print another list items.
for (int j = 0; j < list1.Count; j++)
{
Console.WriteLine("/" + list[i] + "/" + list1[j]);
}
}
我想像这样string tmpS =+ list[i]; 编码来加入下一个列表项。
然后打印tmpS
但编译错误 CS0023:运算符“+”不能应用于“字符串”类型的操作数。
如何打印以下所有项目。(任何类型都可以)
一个 氨基酸 抗体 Aab 阿坝 AB ABA 抗体 抗体 阿巴 乙 巴 BB 巴布 巴巴
(大写数字不交换。小字符应该交换。并且总是在大写数字后附加小字符。)
【问题讨论】:
-
您确定 Aab 必须在 AB 部分吗?
-
你好。没有不同的部分。只需要上面所有的组合项目。 List 将他的项目组合起来,并将他的项目与其他列表项目组合起来。
标签: c# data-structures