#include <stdio.h>
#include <stdlib.h>
struct lista {
int info;
struct lista* prox;
};
typedef struct lista Lista;
Lista* list_new(void) {
return (Lista*)NULL;
}
Lista* list_add(Lista* l, int i) {
Lista
* novo
= malloc(sizeof(Lista
)); novo -> info = i;
novo -> prox = l;
return novo;
}
void list_print(Lista* l) {
do {
l = l->prox;
} while (l != NULL);
}
int main(void) {
Lista* l = list_new();
l = list_add(l, 23);
l = list_add(l, 45);
list_print(l);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnN0cnVjdCBsaXN0YSB7CglpbnQgaW5mbzsKCXN0cnVjdCBsaXN0YSogcHJveDsKfTsKCnR5cGVkZWYgc3RydWN0IGxpc3RhIExpc3RhOwoKTGlzdGEqIGxpc3RfbmV3KHZvaWQpIHsKCXJldHVybiAoTGlzdGEqKU5VTEw7Cn0KCkxpc3RhKiBsaXN0X2FkZChMaXN0YSogbCwgaW50IGkpIHsKCUxpc3RhKiBub3ZvID0gbWFsbG9jKHNpemVvZihMaXN0YSkpOwoJbm92byAtPiBpbmZvID0gaTsKCW5vdm8gLT4gcHJveCA9IGw7CglyZXR1cm4gbm92bzsKfQoKdm9pZCBsaXN0X3ByaW50KExpc3RhKiBsKSB7CglkbyB7CgkJcHJpbnRmKCIlZFx0IixsLT5pbmZvKTsKCQlsID0gbC0+cHJveDsKCX0gd2hpbGUgKGwgIT0gTlVMTCk7IAp9CgppbnQgbWFpbih2b2lkKSB7CglMaXN0YSogbCA9IGxpc3RfbmV3KCk7CglsID0gbGlzdF9hZGQobCwgMjMpOwoJbCA9IGxpc3RfYWRkKGwsIDQ1KTsKCWxpc3RfcHJpbnQobCk7IAoJcmV0dXJuIDA7Cn0=