编写一个打印字符串和该字符串递归的程序 [英] Write a programme that print a string and the recursion for this string

查看:90
本文介绍了编写一个打印字符串和该字符串递归的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我,我需要这个程序秘书
感谢

please help me i need this programme nesecary
thanks

推荐答案

public static boolean ispal(String s)
{
   int len = s.length();
   if (len<=1) 
     return true;
   else
   {
     if (s.charAt(0)==s.charAt(len-1))
       return ispal(s.substring(1,len-1));
   }
   return false;
}


非常感谢您的帮助
Thankssssssssssssssssssss
thanks alot for your help
thanksssssssssssssssssssssss


这篇关于编写一个打印字符串和该字符串递归的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆