#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; // A
p->val = x; // B
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+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnR5cGVkZWYgc3RydWN0IG5vZGUgewogICAgaW50IHZhbDsKICAgIHN0cnVjdCBub2RlICpuZXh0Owp9IE5vZGU7CgpOb2RlICpoZWFkID0gTlVMTDsKCnZvaWQgaW5zSGVhZChpbnQgeCkgewogICAgTm9kZSAqcDsKICAgIHAgPSAoTm9kZSAqKW1hbGxvYyhzaXplb2YoTm9kZSkpOwogICAgcC0+bmV4dCA9IGhlYWQ7ICAvLyBBCiAgICBwLT52YWwgPSB4OyAgICAgIC8vIEIKICAgIGhlYWQgPSBwOwp9Cgp2b2lkIHByaW50TCgpIHsKICAgIE5vZGUgKnAgPSBoZWFkOwogICAgd2hpbGUgKHAgIT0gTlVMTCkgewogICAgICAgIHByaW50ZigiJWQgIiwgcC0+dmFsKTsKICAgICAgICBwID0gcC0+bmV4dDsKICAgIH0KfQoKaW50IG1haW4odm9pZCkgewogICAgaW5zSGVhZCgxKTsKICAgIGluc0hlYWQoMik7CiAgICBpbnNIZWFkKDIpOwogICAgaW5zSGVhZCgzKTsKICAgIHByaW50TCgpOwogICAgcmV0dXJuIDA7Cn0=