#include #include using namespace std; struct Node { int a; Node* next; }; int main() { Node* head = new Node(); head->a = 3; head->next = new Node(); head->next->a = 5; head->next->next = new Node(); head->next->next->a = 4; head->next->next->next = new Node(); head->next->next->next->a = 2; Node* last = head; while (last != NULL) { cout anext->a 전에 head->next = new Node() 해주기