JAVA 求1000内的因子和亲密数对
JAVA 求1000内的因子和亲密数对
日期:2008-10-14 00:02:49 人气:1
public class ChummyNum {
protected int facsum(int m) {
int sum = 1, f;
for (f = 2; f <= m / 2; f++) {
if (m % f == 0) {
sum = sum + f;
}
}
return sum;
}
public static void main(String[] args) {
int m = 3, n,