标签:blog system tostring color logs static als else stringbu
public static void huiwen(){ System.out.println("请输入一串字符串"); Scanner input = new Scanner(System.in); String str = input.nextLine(); StringBuffer sb = new StringBuffer(str); if(str.equals(sb.reverse().toString())){ System.out.println("这串字符串是回文数"); }else{ System.out.println("这串字符串不是回文数"); } }
标签:blog system tostring color logs static als else stringbu
原文地址:http://www.cnblogs.com/0717GG/p/7085426.html