게임 개발 메모장
5. 모두의 약수 본문
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int Result[50001] = {0,};
for (int i = 1; i <= n; ++i)
{
for (int j = i; j <= n; j = j + i)
{
Result[j]++;
}
}
for (int idx = 1; idx <= n; ++idx)
{
cout << Result[idx] << " ";
}
}
'문제 해결력 훈련' 카테고리의 다른 글
7. 숫자의 총 개수 (0) | 2024.01.08 |
---|---|
6. 자릿수의 합 (1) | 2024.01.08 |
4. 영어 단어 복구 (0) | 2024.01.08 |
3. 숫자만 추출 (2) | 2024.01.08 |
2. 나이 계산 (0) | 2024.01.07 |