1104: 求因子和(函数专题)
import java.util.Scanner;
public class Main {
public static int FacSum(int n){
int ans=0;for(int i=1;i<=n/2;i++)if(n%i==0)ans+=i;return ans;}public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int n=cin.nextInt();System.out.println(FacSum(n));}
}