```/**
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*
* C语言声明定义全局变量请加上static,防止重复定义
*/
struct ListNode* ReverseList(struct ListNode* pHead ) {
if(!pHead)return NULL;
if(pHead->next==NULL)return pHead;
struct ListNode *p,*t;
t=pHead->next;
p=pHead;p->next=NULL;
while(t){
p=t;
t=t->next;
p->next=pHead;
pHead=p;
}
return p;
}