728x90
https://school.programmers.co.kr/learn/courses/30/lessons/120846
using System;
public class Solution {
public int solution(int n) {
int answer = 0;
for(int i=1; i<=n; i++){
int tmp= 0;
for(int j=1; j<=n; j++){
if(i%j==0) tmp++;
}
if(3<=tmp) answer++;
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 문자 개수 세기 (0) | 2023.10.14 |
---|---|
[프로그래머스 | C# | Lv.1] 하샤드 수 (0) | 2023.10.13 |
[프로그래머스 | C# | Lv.0] 공배수 (0) | 2023.10.12 |
[프로그래머스 | C# | Lv.0] 문자열 정수의 합 (0) | 2023.10.11 |
[프로그래머스 | C# | Lv.1] 약수의 합 (1) | 2023.10.10 |