약수의 합
1
2
3
4
5
6
7
8
9
10
public int solution(int n){
int sum=0;
for(int i=1; i<= n; i++){
if(n%i == 0){
sum= sum + i;
}
}
return sum;
}
This post is licensed under CC BY 4.0 by the author.