Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ganhadores*insereganhadores(Ganhadores* inicio,char nome)
- {
- Ganhadores* novo = (Ganhadores*) malloc(sizeof(Ganhadores));
- strcpy(novo->nome,nome)
- novo->prox = NULL;
- if (inicio == NULL)
- {
- inicio = novo;
- }
- else
- {
- Ganhadores* p = inicio;
- while (p->prox != NULL)
- {
- p = p->prox;
- }
- p->prox = novo;
- }
- return inicio ;
- }
- int VerificarGanhador(Perdedores*lista,char pais)
- {
- int achou=1;
- Perdedores*aux=lista;
- while(aux!=NULL && achou!=0)
- {
- if(strcmp(lista->nome,pais)==0)
- {
- achou=0;
- }
- else
- {
- aux=aux->prox;
- }
- }
- ///se nao achou eh porque o pais eh ganhador retorna 1
- return achou;
- }
- do
- {
- gmb=VerificarGanhador(lista_perdedores,aux->nome);
- if(gmb==1)
- {
- listadeganhadores=insereganhadores(listadeganhadores,aux->nome);
- }
- aux=aux->prox;
- }while(aux!=Lista);
Add Comment
Please, Sign In to add comment