文章
6
粉丝
553
获赞
11
访问
41.0k
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
BigInteger dividend = scan.nextBigInteger();//被除数
boolean flag = false;
for (int i = 2; i < 10; ++i) {
BigInteger divisor = BigInteger.valueOf(i);//除数
if (dividend.remainder(divisor) == BigInteger.valueOf(0)) {//整除
System.out.print(divisor + " ");
flag = true;
}
}
if (!flag) System.out.print("none");//被除数在 2~9 无因子
System.out.println();
}
}
}
登录后发布评论
暂无评论,来抢沙发