Even_after_odd prooblem | Run and check

case 0 is runtime error .Can u please tell me where i am wrong

#include <bits/stdc++.h>
using namespace std;
class node{
public:
int data;
nodenext;
node(int d){
data=d;
next=NULL;
}
};
void insert(node
&head){

int data;
cin>>data;
node*n=new node(data);
node*temp=head;
if(head==NULL){
    head=n;
}
else{
    while(temp->next){
        temp=temp->next;
    }
    temp->next=n;
}

}
void oddeven(node*&head,int n){
if(n<=1)return ;
nodetemp=head;
node
newll=NULL;
nodepost=NULL;
node
prepost;
while(temp){
if(temp->data&1){
if(newll==NULL){
head=newll=temp;
}
else{
newll->next=temp;
newll=newll->next;
}
}
else{
if(post==NULL)
prepost=post=temp;
else
{ post->next=temp;
post=post->next;
}
}
temp=temp->next;
}
newll->next=prepost;
post->next=NULL;
}
void printll(nodehead){
while(head){
cout<data<<" ";
head=head->next;
}
}
int main() {
int n;
cin>>n;
node
head=NULL;

for(int i=0;i<n;i++){
insert(head);
}

oddeven(head,n);
printll(head);

}