#include <conio.h>
#include <cstdio>
#include <cmath>
int main()
{
int zakres;
printf ("Podaj zakres: \n");
scanf("%d", &zakres);
int f=zakres/2;
bool m[zakres];
for(int n=0;n<zakres;n++) m[n]=1;
for(int k=2;k<f;k++)
if(m[k]) for(int j=k+k;j<zakres;j+=k) m[j]=0;
for(int i=2;i<zakres;i++)
{
if(m)
{
printf("%d ", i);
}
}
getch();
return 0;
}