X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fpalllist.c;h=eb428c1d6b9ba81ea78a72755601e29ea6f0828c;hb=80a2a492f6fe7c9d5b5f069fb37d4650b18f9f00;hp=f6949c1a69db70c84fc916c0102db2b547b64521;hpb=3274c29216a03baeac8668301301b41257fc2fd2;p=16.git diff --git a/src/palllist.c b/src/palllist.c index f6949c1a..eb428c1d 100755 --- a/src/palllist.c +++ b/src/palllist.c @@ -64,31 +64,29 @@ main(int argc, char *argv[]) { int i; node_t * head = NULL; node_t * heao = NULL; - node_t * nx = NULL; head = malloc(sizeof(node_t)); heao = malloc(sizeof(node_t)); head->val = 0; heao->val = 9; head->next=NULL; heao->next=NULL; + head->id=0; heao->id=0; - nx = head; for(i=1; i< //PAL_SIZE - 5 + 7 ; i++) { - printf(" i=%d\n", i); - pushe(nx, i); - nx = nx->next; + if(!(i%3)) printf("\n "); + printf("%d,", i); + pushe(head, i); } - nx->next = NULL; - nx = heao; + printf("\n"); + for(i=8; i>0; i--) { - printf(" i=%d\n", i); - pushe(nx, i); - nx = nx->next; + if(!(i%3)) printf("\n "); + printf("%d,", i); + pushe(heao, i); } - nx->next = NULL; print_list(head); printf("\n"); print_list(heao);