标签:string system edr integer actor color readline rgs exce
import java.io.*;
public class Factorization
{
public void division(int input)
{
for(int i = 2; i <= input / 2; i++)
{
if(input % i == 0)
{
System.out.print(i + "*");
division(input / i);
}
}
System.out.print(input);
System.exit(0);//不能没有这句,否则结果会报错
}
public static void main(String[] args)
{
Factorization f = new Factorization();
String s = "";
try
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
s = in.readLine();
}
catch(IOException e){}
int input = Integer.parseInt(s);
System.out.print(input + "的分解质因数为:" + input + "=");
f.division(input);
}
}
http://m.lcap365.cn http://m.lcap365.cn/pgdb http://m.lcap365.cn/pgbk http://m.lcap365.cn/pgtp http://m.lcap365.cn/pgjs
http://m.lcap365.cn/lcxw http://m.lcap365.cn/dljm
标签:string system edr integer actor color readline rgs exce
原文地址:https://www.cnblogs.com/javaahb/p/12827503.html