#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int val;
struct node *next;
} Node;
Node *head = NULL;
void insHead(int x){
Node *p;
p
= (Node
*)malloc(sizeof(Node
)); p->next = head;
p->val = x;
head = p;
}
void printL(){
Node *p = head;
while(p != NULL){
p = p->next;
}
}
int main(void){
insHead(1);
insHead(2);
insHead(2);
insHead(3);
printL();
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnR5cGVkZWYgc3RydWN0IG5vZGUgewogICAgaW50IHZhbDsKICAgIHN0cnVjdCBub2RlICpuZXh0Owp9IE5vZGU7CgpOb2RlICpoZWFkID0gTlVMTDsKCnZvaWQgaW5zSGVhZChpbnQgeCl7CiAgICBOb2RlICpwOwogICAgcCA9IChOb2RlICopbWFsbG9jKHNpemVvZihOb2RlKSk7CiAgICBwLT5uZXh0ID0gaGVhZDsKICAgIHAtPnZhbCA9IHg7CiAgICBoZWFkID0gcDsKfQoKdm9pZCBwcmludEwoKXsKICAgIE5vZGUgKnAgPSBoZWFkOwogICAgd2hpbGUocCAhPSBOVUxMKXsKICAgICAgICBwcmludGYoIiVkICIsIHAtPnZhbCk7CiAgICAgICAgcCA9IHAtPm5leHQ7CiAgICB9Cn0KCmludCBtYWluKHZvaWQpewogICAgaW5zSGVhZCgxKTsKICAgIGluc0hlYWQoMik7CiAgICBpbnNIZWFkKDIpOwogICAgaW5zSGVhZCgzKTsKICAgIHByaW50TCgpOwogICAgcmV0dXJuIDA7Cn0K