按照你的要求编写的Java程序如下:
import java.util.Scanner;
public class CCT{
public static void f(int n,int m){
int i=2;
if(n<2)return;
while(!(n%i==0)){
i++;
}
if(m==1)System.out.print(i);
else System.out.print("*"+i);
f(n/i,m-1);
return;
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
System.out.print(n+"=");
f(n,1);
System.out.println();
}
}运行结果:90
90=2*3*3*5