//--------------------------算法三:----------- Console.WriteLine("算法3:请输入一个字符串!"); string str3 = Console.ReadLine(); string s=null; //将str3压入栈中 for (int i = 0; i < str3.Length; ++i) {   stack.Push(str3[i]); } //循环将栈元素放入s中 while (stack.Count>0) {   s +=stack.Pop().ToString(); } if (str3!= s) {   Console.WriteLine("这不是回文"); } else{ Console.WriteLine("这是回文");}   Console.ReadLine(); //csharp/7218