<file_sep>struct node { int key; struct node *next; };

struct node *head, *z, *t;

list_initialize() {
  head = (struct node *) malloc(sizeof *head);
  z = (struct node *) malloc(sizeof *z);
  head->next = z; z->next = z;
}

delete_next(struct node *t) { t->next = t->next->next; }

struct node *insert_after(int v, struct node *t) {
  struct node *x;
  x = (struct node *) malloc(sizeof *x);
  x->key = v; x->next = t->next;
  t->next = x;
  return x;
}
<file_sep>#define N 1000

main() {
  int i, j, a[N + 1];

  for (a[1] = 0, i = 2; i <= N; i++) a[i] = 1;

  for (i = 2; i <= N/2; i++)
    for (j = 2; j <= N/i; j++)
      a[i * j] = 0;
  
  for (i = 1; i <= N; i++)
    if (a[i]) printf("%4d", i);

  printf("\n");
}
