#include <stdio.h>
#include <math.h>
int main()
{ int i,j,n;
int t=0;
while(1)
{
printf("Please input n:");
scanf("%d",&n);
for(i=2;i<=n;i++)
{ for(j=2;j<=sqrt(i);j++)
{ if(i%j==0)
t++;
}
if(t==0)
printf("%d\t",i);
t=0;
}
printf("\n");
}
return 0;
}