package the1;
import java.util.Scanner;
import javax.swing.JOptionPane;
//import java.util.Strinpublic class huiwenchuan {public static void main(String[] args) {// TODO Auto-generated method st//System.out.printf("为何不能输出");Scanner s=new Scanner(System.in);String a=s.next();StringBuffer b=new StringBuffer(a);b.reverse();String c=b.toString();if(a.equals(c)==true) {System.out.printf("%s是回文串\n",a);//OptionPane.showMessageDialog(null,"是回文串",JOptionPane.INFORMATION_MESSAGE);}else {System.out.printf("%s不是回文串\n",a);}}}
![](https://img.php1.cn/3cd4a/1eebe/cd5/b386c433a16f5497.webp?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzU1MjAwNg==,size_16,color_FFFFFF,t_70)