#include "stdafx.h" #include "stdlib.h" #include<iostream> using namespace std; typedef struct node{ int value; node * next; }* LNode ; int main(int argc, char* argv[]) { LNode Inputlist(); void OutPutList(const LNode head); LNode Converse(LNode head); LNode head =Inputlist(); OutPutList(head); head = Converse(head); OutPutList(head); free(head); return 0; } //链表的反转 LNode Converse(LNode head) { LNode A,B,C; A=head; B=head->next; C=head->next->next; head->next=NULL; while (C!=NULL) { B->next=A; A=B; B=C; C=C->next; } B->next=A; head =B; return head; } //链表输入 输入11结束链表 LNode Inputlist() { LNode head,p; head =(LNode)malloc(sizeof(node)); int a; cin>>a; if(a!=11) { head->value=a; p=head; } else { head=NULL; return head; } cin>>a; while (a!=11) { p->next =(LNode)malloc(sizeof(node)); p->next->value=a; p=p->next; cin>>a; } p->next=NULL; return head; } //链表输出 void OutPutList(const LNode head) { LNode p; p=head; while(p->next!=NULL) { cout<<p->value<<"->"; p=p->next; } cout<<p->value<<endl; } //输入ad sd d 输出ad,sd,d, void DivideString(const char *pInputStr, long lInputLen, char *pOutputStr) { long j = 0; for(long i=0;pInputStr[i]!='