![프로그래머스 Lv.0 합성수 찾기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqHT0r%2FbtsDLr553nX%2FdL5kJUDn910ivaHoZy1WK0%2Fimg.png)
프로그래머스 Lv.0 합성수 찾기개발자가 되기까지 (2023.08.16~2024.04.15)/[Algorithm] Programmers ver.Java2024. 1. 22. 13:30
Table of Contents
<Solution>
class Solution {
public int solution(int n) {
int answer = 0;
int num = 0;
for(int i = 1; i <= n; i++){
for(int j =1; j <= i; j++) {
if(i % j == 0) {
num++;
}
}
if( num >= 3) {
answer++;
}
num = 0;
}
return answer;
}
}
728x90
@rlozlr :: 얼렁뚱땅 개발자
얼렁뚱땅 주니어 개발자
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!