package work;import java.util.*;public class youxiang {public static void main(String[]args){Scanner input=new Scanner(System.in);System.out.println("请输入一个字符串");String s=input.next();StringBuffer SB=new StringBuffer(s);System.out.println(SB.reverse());String str=SB.toString(SB.reverse());if(s==str){System.out.println("该字符串是回文");}}}
添加回答
举报
0/150
提交
取消