반응형
https://www.acmicpc.net/problem/2501
-문제-
-정답-
#include <iostream>
#include <vector>
using namespace std;
vector<int> arr;
int main() {
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
if (n % i == 0) {
arr.push_back(i);
}
else {
continue;
}
}
cout << arr[k - 1];
return 0;
}
반응형