1234567891011121314151617181920212223
struct Node{ string val; Node* next; }; Node* makeList () { string current; Node* n; Node* head= NULL; Node* temp = n; while(cin>>current && !cin.fail()) { n = new Node; n->val = current; temp ->next = n; temp = temp -> next; } n->next = NULL; return n; }