class Solution {

public:

```
ListNode* oddEvenList(ListNode* head) {
ListNode *a, *b, *cur;
cur=head;
b=cur->next;
a=b;
while(cur->next!=NULL&&cur->next->next!=NULL)
{
cur->next=cur->next->next;
a->next=cur->next->next;
cur=cur->next;
a=a->next;
}
cur->next=b;
return head;
}
```

};