public class Main{ public static void main(String[] args) { int num = 0; for (int a = 1; a < 10; a++) { for (int b = 1; b < 10; b++) { if (a!=b){ for (int c = 1; c < 10; c++) { if (a!=c&&b!=c){ for (int d = 1; d < 10; d++) { if (a!=d&&b!=d&&c!=d){ for (int e = 1; e < 10; e++) { if (e!=a&&e!=b&&e!=c&&e!=d){ if ((a*10+b)*(c*100+d*10+e)==(a*100+d*10+b)*(c*10+e)){ System.out.println(a+""+b+"*"+c+""+d+""+e+"="+a+""+d+""+b+"*"+c+""+d); num++; } } } } } } } } } } System.out.println(num); } }
原文:https://www.cnblogs.com/qzhc/p/12347292.html