public class huishu{ public void huishu ( ) { t=SimpleInput.readInt( ); int a , j; int d = t; while(t>0){ t=t/10; j++; } int b[]=b[j]; for(int i=0;d>0;i++){ a=d%10; b=a; d=d/10; } } public boolean judge( ){ for(int i=0; i<b.length/2; i++){ if(b!=b[b.length-1-i]){ return false; } return false; } } public static void main(String args[]){ huishu aCase=huishu( ); if(judge( )) System.out.println("是回数"); else System.out.println(" 不是回数"); } } class SimpleInput { public static String readString( ) // 从键盘读取一个字符串 { BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1); // 定义一个字符串 String string = ""; try { string = br.readLine( ); }catch (IOException ex) { System.out.println(ex); } return string; } // 从键盘读取一个整数 public static int readInt( ) { return Integer.parseInt(readString( )); } // 从键盘读取一个double类型的浮点数 public static double readDouble( ) { return Double.parseDouble(readString( )); } // 从键盘读取一个字节整数 public static byte readByte( ) { return Byte.parseByte(readString( )); } // 从键盘读取一个短整数 public static short readShort( ) { return Short.parseShort(readString( )); } // 从键盘读取一个长整数 public static long readLong( ) { return Long.parseLong(readString( )); } // 从键盘读取一个float 类型的浮点数 public static float readFloat( ) { return Float.parseFloat(readString( )); } } |