#include
int main()
{
int a[5000-2+1];
int i;
int *p;
int offset = 2;
p = a;
for(i = 2; i <= 5000; i++)
{ *p = i;
p++;
}
p = a;
while(offset < 5000)
{
printf(“%d\n“,offset);
while(p >= a && p + offset < a + 5000 - 2)
{
*(p+offset) = 0;
p = p + offset;
}
p=a + offset - 2;
while(!*(p + 1))
p++;
offset = *(p + 1);
p = a + offset - 2;
}
return 0;
}
阅读(1222) | 评论(1) | 转发(0) |