public class A {
public static void main(String[] args) throws Exception{
for(int i = 10; i < 100; i++){
for(int j=10;j<100;j++){
String a = i*j+"";//将结果转为String 类型
String b = i+""+j;
if(check(a,b)){
System.out.println(i+","+j+", "+(i*j));
}
}
}
}
public static boolean check(String a,String b){
char [] ch1 = a.toCharArray();//转为char 类型数组
char [] ch2 = b.toCharArray();
Arrays.sort(ch1);//排序
Arrays.sort(ch2);//排序
if(Arrays.equals(ch1, ch2)){//判断
return true;
}
return false;
}
}