JAVA 求1000内的因子和亲密数对

日期:2008-10-14 00:02:49 人气:1

JAVA 求1000内的因子和亲密数对

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,
    A+
热门评论