C3 code for palindrome detection

From , 3 Years ago, written in C#, viewed 125 times.
URL https://pastebin.vip/view/fc452d06
  1. //--------------------------算法三:-----------
  2.  
  3. Console.WriteLine("算法3:请输入一个字符串!");
  4. string str3 = Console.ReadLine();
  5. string s=null;
  6. //将str3压入栈中
  7. for (int i = 0; i < str3.Length; ++i)
  8. {
  9.   stack.Push(str3[i]);
  10. }
  11. //循环将栈元素放入s中
  12. while (stack.Count>0)
  13. {
  14.   s +=stack.Pop().ToString();
  15. }
  16.  
  17. if (str3!= s)
  18. {
  19.   Console.WriteLine("这不是回文");
  20. }
  21. else{ Console.WriteLine("这是回文");}
  22.   Console.ReadLine();
  23. //csharp/7218

Reply to "C3 code for palindrome detection"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website