判断回文递归算法实现

static bool IsPalindrome(string s)
{
if (num >= s.Length - num - 1)
{
return true;
}
else if (s[num] == s[s.Length - num - 1])
{
num
++; // 全局变量
IsPalindrome(s);
return true;
}
else
{
return false;
}
}

posted @ 2011-02-15 17:14  kntao  阅读(205)  评论(0)    收藏  举报