<%@ page contentType="text/html;charset=GBK" %> 
<%!
 	String getPalindromeFlag(String input)
   	{
     		StringBuffer strinput=new StringBuffer(input);
     		String revinput=new String(strinput.reverse());
     		if(input.equals(revinput))
     			{return "是";}
     		else
     			{return "不是";}
   	}
%>
<%
  	String str1="aba";
  	String str2="abab";
  	String str3="lovevol";
  	String flag1=getPalindromeFlag(str1);
  	String flag2=getPalindromeFlag(str2);
  	String flag3=getPalindromeFlag(str3);
%>
<HTML>
<HEAD>
<TITLE>回文</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
<H2 align="center">&nbsp; </H2>
<H2 align="center">回文字符串判断</H2>
<TABLE width="300" border="1" align="center">
  	<TR>
    		<TD>
      		<div align="center">字符串</div>
    		</TD>   
    		<TD>
      		<div align="center">是否是回文</div>
    		</TD>
   	</TR>
  	<TR>
    		<TD>&nbsp;<%=str1 %> </TD>
    		<TD>&nbsp;<%=flag1 %> </TD>
   	</TR>
 	<TR>
    		<TD>&nbsp;<%=str2 %> </TD>
    		<TD>&nbsp;<%=flag2 %> </TD>
   	</TR>
 	<TR>
    		<TD>&nbsp;<%=str3 %> </TD>
    		<TD>&nbsp;<%=flag3 %> </TD>
   	</TR>
</TABLE>
<H2 align="center">&nbsp;</H2>
</BODY>
</HTML>
