#include <iostream>
using namespace std;
int* fSimple(int intMax)
{
int Array[100];
Array[0] = 2;
int intCount = 1;
bool bGood;
for (int i = 3; i < intMax; i++)
{
bGood = true;
for (int j = 1; j < intCount; j++)
if (i%Array[j] == 0) bGood = false;
if (bGood) Array[++intCount] = i;
}
Array[0] = intCount;
return Array;
}
int main()
{
int *p = fSimple(100);
for (int i = 1; i < p[0]; i++)
cout << p[i] << " ";
return 0;
}