bing 比赛部分代码

public List CutHeadLeaveTail(string str, out int cutCount) { cutCount = 0; char[] temp = str.ToCharArray(); List list = new List(); for (int i = 0; i < temp.Length; i++) { list.Add(temp[i].ToString()); } for (int i = 0; i < list.Count; i++) { if (list[i] != "b") { list.RemoveAt(0); cutCount++; i -= 1; } else { break; } } for (int i = list.Count - 1; i > 0; i--) { if (list[i] != "g") { list.RemoveAt(i); } else { break; } } return list; }

bing 比赛部分代码

上一篇:HDU 1159 Common Subsequence


下一篇:dreamweaver 去掉空格