标签:out oid 回文 amp while length str span else
public class App5_6 {
public static void main(String[] args)
{
String str="126747621";
int i=0,n;
boolean yn=true;
if(args.length>0)
str=args[0];
System.out.println("str="+str);
n=str.length();
char sChar,eChar;
while(yn && (i<n/2))
{
sChar=str.charAt(i);
eChar=str.charAt(n-i-1);
System.out.println("sChar"+i+"="+sChar+" echar"+(n-i-1)+"="+eChar);
if(sChar==eChar)
i++;
else
yn=false;
}
System.out.println("算法1:"+yn);
}
}
标签:out oid 回文 amp while length str span else
原文地址:https://www.cnblogs.com/duanqibo/p/11131902.html