思路:注意不要加包名,会导致运行时错误
package PRactice;import java.util.Arrays;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int x = 1; boolean flag = true; while(n != 1) { x++; while(n % x == 0) { n /= x; if(flag) { flag = false; System.out.print(x); } else { System.out.print("*" + x); } } } System.out.println(); }}
新闻热点
疑难解答