解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class text022 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int x = 1;
int t = 1;
if (a==1) {
System.out.print(1);
}
else {
while (a != 1) {
x++;// 从2开始判断能否被n整除
while (a % x == 0) {
a/= x;
if (t == 1) {
System.out.print(x);//输出可以被n整除的第一个数
t = 0;
} else
System.out.print("*" + x);
}
}
}
}
}
0.0分
1 人评分