蓝桥杯练习系统ALGO-444
import java.util.Scanner;
public class ALGO_444pass {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num=sc.nextInt();
System.out.println(factor_sum(num));
sc.close();
}
public static int factor_sum(int num) {
int count=0;
for (int i = 1; i <num; i++) {
if(num%i==0) {
count+=i;
}
}
return count;
}
}