728x90
https://school.programmers.co.kr/learn/courses/30/lessons/120836
📝 나의 풀이
using System;
public class Solution {
public int solution(int n) {
int answer = 0;
for(int i=1; i<=n; i++){
if(n%i==0) answer++;
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 문자열을 정수로 변환하기 (0) | 2023.08.25 |
---|---|
[프로그래머스 | C# | Lv.0] rny_string (1) | 2023.08.24 |
[프로그래머스 | C# | Lv.0] 문자열로 변환 (0) | 2023.08.23 |
[프로그래머스 | C# | Lv.0] n개 간격의 원소들 (0) | 2023.08.23 |
[프로그래머스 | C# | Lv.0] 숫자 찾기 (0) | 2023.08.22 |