2012年4月23日

[原]字符串反转

摘要: 使用栈public static string ReverseByStack(this string original){ Stack<char> stack = new Stack<char>(); foreach (char ch in original) { stack.Push(ch); } char[] c = new char[original.Length]; for (int i = 0; i < original.Length; i++) { c[i] = stack.Pop(); } retu... 阅读全文

posted @ 2012-04-23 12:53 tilltheendwjx 阅读(159) 评论(0) 推荐(0) 编辑

导航