185. 연결 리스트 머리 삽입과 출력 순서
다음 C 프로그램의 실행 결과를 쓰시오.
1#include <stdio.h>2#include <stdlib.h>34struct Node {5char ch;6struct Node *next;7};89int main(void) {10const char *s = "DOG";11struct Node *head = NULL, *n;12int i;13for (i = 0; s[i] != '\0'; i++) {14n = (struct Node *)malloc(sizeof(struct Node));15n->ch = s[i];16n->next = head;17head = n;18}19while (head != NULL) {20printf("%c", head->ch);21n = head;22head = head->next;23free(n);24}25printf("\n");26return 0;27}