/* 3. ´ÙÀ½ C ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include #include int key[5] = { 1, 2, 3, 4, 5}; struct node { int num; struct node *next; }; main() { struct node *p; struct node *q; int i; p = (struct node *)malloc(sizeof(struct node)); p->num = key[0]; for(i = 1; i < 5; i++) { q = (struct node *)malloc(sizeof(struct node)); q->num = key[i]; p->next = q; q->next = q; } for(i = 0; i < 5; i++) { printf("%d ",p->num); p = p->next; } }