#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Time{
char name[30];
int pnts;
int vit, emp, der;
int gf, gt;
struct Time *next;
struct Time *prev;
typedef struct campeonato
{ time *first
; } campeonato
;
void addTime(campeonato *c, char name[]) {
t->next = NULL;
t->pnts = t->vit = t->emp = t->der = t->gt = t->gf = 0;
if (c->first == NULL) {
c->first = t;
t->prev = NULL;
} else {
while (p->next != NULL) {
p = p->next;
}
p->next = t;
t->prev = p;
}
}
int main(void) {
campeonato c = { .first = NULL };
addTime(&c, "Santos");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKdHlwZWRlZiBzdHJ1Y3QgVGltZXsKICBjaGFyIG5hbWVbMzBdOwogIGludCBwbnRzOwogIGludCB2aXQsIGVtcCwgZGVyOwogIGludCBnZiwgZ3Q7CgogIHN0cnVjdCBUaW1lICpuZXh0OwogIHN0cnVjdCBUaW1lICpwcmV2Owp9IHRpbWU7Cgp0eXBlZGVmIHN0cnVjdCBjYW1wZW9uYXRvIHsgdGltZSAqZmlyc3Q7IH0gY2FtcGVvbmF0bzsKCnZvaWQgYWRkVGltZShjYW1wZW9uYXRvICpjLCBjaGFyIG5hbWVbXSkgewogICAgdGltZSAqdCA9IG1hbGxvYyhzaXplb2YodGltZSkpOwoJc3RyY3B5KHQtPm5hbWUsIG5hbWUpOwogICAgdC0+bmV4dCA9IE5VTEw7CiAgICB0LT5wbnRzID0gdC0+dml0ID0gdC0+ZW1wID0gdC0+ZGVyID0gdC0+Z3QgPSB0LT5nZiA9IDA7CiAgICBpZiAoYy0+Zmlyc3QgPT0gTlVMTCkgewogICAgCWMtPmZpcnN0ID0gIHQ7CgkgICAgdC0+cHJldiA9IE5VTEw7CiAgICB9IGVsc2UgewoJICAgIHRpbWUgKnAgPSBjLT5maXJzdDsKICAgIAl3aGlsZSAocC0+bmV4dCAhPSBOVUxMKSB7CgkgICAg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