摘要:
C#使用栈判断回文字符串class Program { static void Main(string[] args) { //判断回文数 CStack myStack=new CStack(); string word = "sys"; string ch; bool isHuiWen =true; //栈是LIFO,字符串入栈,出栈时最后一个字符先出。 for (int i = 0; i < word.Length; i++) { myStack.Push(word[i]); } int pos = 0; //出栈字符依次和原字符串字符比较 while (pos 阅读全文