728x90
반응형
SMALL
#include <string>
#include <vector>
using namespace std;
vector<int> solution(int n) {
vector<int> answer;
for(int i=1; i<n+1; i++){
if(n%i==0)
answer.push_back(i);
}
return answer;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
[프로그래머스] 문자열 정렬하기 (2) (0) | 2025.09.06 |
---|---|
[프로그래머스] 가장 큰 수 찾기 (0) | 2025.09.06 |
[프로그래머스] 인덱스 바꾸기 (0) | 2025.09.05 |
[프로그래머스] 대문자와 소문자 (0) | 2025.09.05 |
[프로그래머스] 암호 해독 (0) | 2025.09.05 |
댓글