#include <stdio.h>
#include <stdlib.h>
struct cel
{
int v;
struct cel *prox;
};
typedef struct cel celula;
void escreve(celula *ini)
{
while(ini != NULL)
{
ini= ini->prox;
}
}
void inserefim(celula **ini)
{
celula *aux;
celula *fim;
int x;
do{
if(x)
{
aux
=(celula
*) malloc(sizeof(celula
)); aux->v = x;
aux->prox = NULL;
if(*ini == NULL){
*ini = aux;
}else{
fim->prox = aux;
}
fim = aux;
}
}while(x);
}
int main()
{
celula *inicio;
inicio = NULL;
inserefim(&inicio);
escreve(inicio);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnN0cnVjdCBjZWwKewogICAgaW50IHY7CiAgICBzdHJ1Y3QgY2VsICpwcm94Owp9Owp0eXBlZGVmIHN0cnVjdCBjZWwgY2VsdWxhOwoKdm9pZCBlc2NyZXZlKGNlbHVsYSAqaW5pKQp7CiAgICB3aGlsZShpbmkgIT0gTlVMTCkKICAgIHsKICAgICAgICBwcmludGYoIlxuTlVNOiVkIixpbmktPnYpOwogICAgICAgIGluaT0gaW5pLT5wcm94OwogICAgfQp9CnZvaWQgaW5zZXJlZmltKGNlbHVsYSAqKmluaSkKewogICAgY2VsdWxhICphdXg7CiAgICBjZWx1bGEgKmZpbTsKICAgIGludCB4OwogICAgZG97CiAgICAgICAgc2NhbmYoIiVkIiwmeCk7CiAgICAgICAgaWYoeCkKICAgICAgICB7CiAgICAgICAgICAgIGF1eCA9KGNlbHVsYSopIG1hbGxvYyhzaXplb2YoY2VsdWxhKSk7CiAgICAgICAgICAgIGF1eC0+diA9IHg7CiAgICAgICAgICAgIGF1eC0+cHJveCA9IE5VTEw7CgogICAgICAgICAgICBpZigqaW5pID09IE5VTEwpewogICAgICAgICAgICAgICAgKmluaSA9IGF1eDsKICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICBmaW0tPnByb3ggPSBhdXg7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZpbSA9IGF1eDsKICAgICAgICB9CiAgICB9d2hpbGUoeCk7Cn0KCmludCBtYWluKCkKewogICAgY2VsdWxhICppbmljaW87CiAgICBpbmljaW8gPSBOVUxMOwogICAgaW5zZXJlZmltKCZpbmljaW8pOwogICAgZXNjcmV2ZShpbmljaW8pOwogICAgcmV0dXJuIDA7Cn0=