文件目录

#include <iostream>
using namespace std;
int ispri[10000] = {1, 1}; // 1:不是质数 0:是质数
void init()
{
    for (int i = 2; i <= 100; i++)
        if (ispri[i] == 0)
            for (int j = i * i; j < 10000; j += i)
                if (!ispri[j])
                    ispri[j] = 1;
}
int getzyz(int n)
{
    for (int i = 2; i < n; i++)
        if (n % i == 0 && ispri[n / i] == 0)
            return n / i;
    return n;
}
int main()
{
    init();
    int m = 5, n = 10;
    cin >> m >> n;
    bool f = true;
    for (int i = m; i <= n; i++)
        if (f)
        {
            cout << getzyz(i);
            f = 0;
        }
        else
            cout << "," << getzyz(i);
    return 0;
}