Review of terms in Computation
矩阵二分乘求解递推数列

质因数分解

Jimmy posted @ 2011年10月05日 03:41 in Others , 1217 阅读

自己写的这个程序过于复杂,上网搜了之后发现可以有很简单的实现。

import java.io.*;
import java.util.*;

public class divide {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int i = 0;
		int j = 2;
		if(sc.hasNext())
			i = Integer.parseInt(sc.nextLine());
		System.out.printf("%d = ",i);
		do 
		{
			if (i % j == 0) 
			{
				System.out.printf("%d*",j);
				i = i / j;
				j = 2;
			} 
			else
				j++;
			if (i == 1)
				break;
		} while (true);
		System.out.printf("%c", '\b');
	}
}
Avatar_small
192.168.l.l 说:
2019年12月03日 20:11
The most common wired networks use cables connected at one end to an Ethernet port on the network router and at the other end to a computer or other device. You can find the tutorials to change its settings on 192.168.l.l

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter