#include <stdio.h>
#include <stdlib.h>
typedef struct lligada {
int valor;
struct lligada *prox;
} *LInt;
LInt insereL (LInt l, int x) {
LInt new;
new
= malloc(sizeof(struct lligada
)); new->valor = x;
new->prox = l;
return new;
}
void imprimeL (LInt l) {
while (l != NULL) {
l = l -> prox;
}
}
int main() {
LInt new;
new = insereL(new, 5);
new = insereL(new, 4);
new = insereL(new, 3);
imprimeL(new);
return EXIT_SUCCESS;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnR5cGVkZWYgc3RydWN0IGxsaWdhZGEgewoJaW50IHZhbG9yOwoJc3RydWN0IGxsaWdhZGEgKnByb3g7Cn0gKkxJbnQ7CgoKTEludCBpbnNlcmVMIChMSW50IGwsIGludCB4KSB7CglMSW50IG5ldzsKCW5ldyA9IG1hbGxvYyhzaXplb2Yoc3RydWN0IGxsaWdhZGEpKTsKCW5ldy0+dmFsb3IgPSB4OwoJbmV3LT5wcm94ID0gbDsKCXJldHVybiBuZXc7Cn0KCnZvaWQgaW1wcmltZUwgKExJbnQgbCkgewoJd2hpbGUgKGwgIT0gTlVMTCkgewoJCXByaW50ZigiJWRcbiIsIGwgLT4gdmFsb3IpOwoJCWwgPSBsIC0+IHByb3g7Cgl9Cn0KCmludCBtYWluKCkgewoJTEludCBuZXc7CgluZXcgPSBpbnNlcmVMKG5ldywgNSk7CgluZXcgPSBpbnNlcmVMKG5ldywgNCk7CgluZXcgPSBpbnNlcmVMKG5ldywgMyk7CglpbXByaW1lTChuZXcpOwoKCXJldHVybiBFWElUX1NVQ0NFU1M7Cn0K