2012-01-17 20:19:51Morris
[JAVA] a022. 迴文
import java.util.Scanner;
public class a022{
public static void main(String []args) {
Scanner cin = new Scanner(System.in);
String s;
while(cin.hasNextLine()) {
s = cin.nextLine();
int i = 0, flag = 0, len = s.length();
for(i = 0; i < len; i++)
if(s.charAt(i) != s.charAt(len-i-1))
flag = 1;
if(flag == 0)
System.out.println("yes");
else
System.out.println("no");
}
}
}
public class a022{
public static void main(String []args) {
Scanner cin = new Scanner(System.in);
String s;
while(cin.hasNextLine()) {
s = cin.nextLine();
int i = 0, flag = 0, len = s.length();
for(i = 0; i < len; i++)
if(s.charAt(i) != s.charAt(len-i-1))
flag = 1;
if(flag == 0)
System.out.println("yes");
else
System.out.println("no");
}
}
}