标签:write ble span proxy zab bst abc void com
[Serializable]
[ComVisible(true)]
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(Stack.StackDebugView))]
public class Stack : ICollection, IEnumerable, ICloneable
{}
堆栈 判断回文数
static void Main(string[] args) { string str = "abcba"; bool flag = true; //for (int i = 0; i <= str.Length/2; i++) //{ // if (str[i]!=str[str.Length-1-i]) // { // flag = false; // } //} Stack list = new Stack(); string ch; for (int i = 0; i < str.Length; i++) { list.Push(str[i]); } int pos = 0; while(list.Count>0) { ch = list.Pop().ToString(); if (ch!=str.Substring(pos,1)) { flag = false; break; } pos++; } Console.WriteLine(flag); Console.ReadLine(); }
标签:write ble span proxy zab bst abc void com
原文地址:http://www.cnblogs.com/futengsheng/p/7842830.html