Сумма делителей числа. Помогите разложить на элементарные комманды. Алгоритм 1
public static int summ_of_del2(int num) {
int summ = 0;
int max_del = num;
int cur_del = 2;
while (cur_del < max_del) {
if (num % cur_del == 0) {
max_del = num / cur_del;
summ += cur_del;
summ += max_del;
}
cur_del++;
}
summ = summ + 1;
return summ;
}
public static int summ_of_del3(int num) {
int summ = 0;
int m = (int) Math.sqrt(num);
int tmp;
for (int k=2; k <= m; ++k) {
if (num % k==0) {
summ += k;
tmp = num / k;
if (k != tmp) {
summ += tmp;
}
}
}
return summ;
}