프로그래머스 - 약수의 합

parkkhee·2023년 2월 26일
0
class Solution {
  public int solution(int n) {
      int answer = 0;
      
      for(int i=1; i<=n; i++){
          
          if(n%i==0){
              answer+=i;
          }
          
      }
      
      return answer;
  }
}
profile
순우리말 백엔드 개발자

0개의 댓글