文件目录

#include <iostream>
using namespace std;
// 因子之和
int getsum(int num)
{
    int ans = 0;
    for (int i = 1; i < num; i++)
    {
        if (num % i == 0)
            ans += i;
    }
    return ans;
}
int main()
{
    int n;
    cin >> n;
    for (int i = 2; i <= n; i++)
    {
        if (i == getsum(i))
        {
            cout << i << endl;
        }
    }
    return 0;
}