这是我的,没用你那个
# include <stdio.h>
main ()
{
int x,i,j;
printf("N=?");
scanf("%d",&x);
for (i=2;i<=x;i++)
{
for (j=2;j<i;j++)
{
if (i%j==0)
break;
}
if (j==i)
printf("%d\n",i);
}
}
# include <stdio.h>
main ()
{
int x,i,j;
printf("N=?");
scanf("%d",&x);
for (i=2;i<=x;i++)
{
for (j=2;j<i;j++)
{
if (i%j==0)
break;
}
if (j==i)
printf("%d\n",i);
}
}