厄拉多塞筛
#define NUM 100
bool num[NUM];
void Prime()
{
for (int i = 2; i < NUM; ++i) num[i] = true;
for (int i = 2; i < NUM; ++i)
{
if (num[i])
{
for (int j = 2; j*i < NUM; ++j) num[j*i] = false;
}
}
for (int i = 2; i < NUM; ++i) if (num[i])cout << i << endl;
}
#define NUM 100
bool num[NUM];
void Prime()
{
for (int i = 2; i < NUM; ++i) num[i] = true;
for (int i = 2; i < NUM; ++i)
{
if (num[i])
{
for (int j = 2; j*i < NUM; ++j) num[j*i] = false;
}
}
for (int i = 2; i < NUM; ++i) if (num[i])cout << i << endl;
}