218. 연결 리스트에서 짝지어 값 교환
다음 C 프로그램의 실행 결과를 쓰시오.
1#include <stdio.h>23struct Node {4int val;5struct Node *next;6};78int main() {9struct Node e = {5, NULL};10struct Node d = {1, &e};11struct Node c = {8, &d};12struct Node b = {3, &c};13struct Node a = {7, &b};14struct Node *p = &a;15int t;16while (p != NULL && p->next != NULL) {17t = p->val;18p->val = p->next->val;19p->next->val = t;20p = p->next->next;21}22for (p = &a; p != NULL; p = p->next) {23printf("%d ", p->val);24}25printf("\n");26return 0;27}