package com.abc.example; import java.util.Scanner; /* * 分解质因数 */ public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个数字"); int n=sc.nextInt(); int k=2; System.out.print(n+"="); while(k<=n) { if(k==n) { System.out.print(n); break; } else if(n%k==0) { System.out.print(k+"*"); n=n/k; } else { k++; } } sc.close(); } }
最近浏览更多
lipanlong LV10
2023年7月6日
黑 LV7
2023年3月29日
antoniozhuster LV7
2023年3月21日
微信网友_6393635955937280
2023年3月18日
暂无贡献等级
qwertyui惊鸿 LV7
2023年3月17日
BestClever LV32
2023年3月14日
212828939 LV16
2023年3月13日
itlaolang LV5
2023年3月10日
Dcat980 LV2
2023年3月5日
最代码官方 LV167
2023年3月4日