uploaded at 2022. 12. 9. 오후 5:45:02

This commit is contained in:
rl544
2022-12-09 17:45:04 +09:00
parent 4e4645ddf7
commit b8d1f7e874
+11
View File
@@ -0,0 +1,11 @@
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/12928
class Solution {
public int solution(int n) {
int answer = 0;
for (int i = 1; i <= n; i++){
answer += (n%i==0) ? i : 0;
}
return answer;
}
}