package com.test01;//2022.7.13
import java.util.Scanner;
public class test01 {
public static void main(String[] args) {
System.out.println("请输入一个数!");
Scanner a = new Scanner(System.in);
int date = a.nextInt();//获取键盘上的数值给date
System.out.print(date + "=");
for (int i = 2; i < date+1; i++) { //i的值需要从 2 开始,不能从 1 开始
while (date%i == 0 && i != date){ //满足条件的值则为date的因数
date = date/i;
System.out.print(i + "*");
}
if(i == date) {
System.out.println(i);
}
}
}
}
11-15
1891
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-07
1032
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)