[java] 프로그래머스 - 순서쌍의 개수

세상을 바꾸는 개발자·2023년 3월 14일
0

[문제링크 - 프로그래머스 - 순서쌍의 개수] https://school.programmers.co.kr/learn/courses/30/lessons/120836

class Solution {
    public int solution(int n) {
        int answer = 0;
        for(int i=1; i<=n; i++){
            if(n%i==0)
                answer++;
        }
        return answer;
    }
}
profile
초심 잃지 않기

0개의 댓글