import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); for(int i=a; i<=b; i++) { if (i >= 3) { String m = ""; int k = 2; int j = i; while (j != k) { if (j % k == 0) { m = m + k + "*"; j = j / k; } else if (j % k != 0) { k++; } } m = m + k; System.out.println(i + "=" + m); } else { System.out.println(i + "=" + i); } } } }
转载:https://blog.csdn.net/m0_38046610/article/details/79660480