Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AdicionarPergunta(Pergunta *P, LPerguntas *LP)
- {
- if(!LP)
- {
- printf("Lista de perguntas inexistente!\n");
- return;
- }
- sprintf(P->Codigo, "P%d", ++LP->Nel[4]);
- if(!LP->Hash[P->Dificuldade-1])
- {
- LP->Hash[P->Dificuldade-1] = CNP();
- LP->Hash[P->Dificuldade-1]->Info = P;
- }
- else
- {
- NPerguntas *N = CNP();
- N->Info = P;
- N->prox = LP->Hash[P->Dificuldade-1];
- LP->Hash[P->Dificuldade-1] = N;
- }
- LP->Nel[P->Dificuldade-1]++;
- }
- void RemoverPergunta(NPerguntas *P)
- {
- if(P->Info->LRespostas)
- EliminarListaRespostas(P->Info->LRespostas);
- free(P->Info->Codigo);
- free(P->Info->Enunciado);
- free(P->Info);
- free(P);
- }
- void VerPerguntas(LPerguntas *LP)
- {
- if(!LP)
- {
- printf("Lista de perguntas inexistente!\n");
- return;
- }
- NPerguntas *P = NULL;
- for(int i = 0; i<4; i++)
- {
- printf("\n\nDificuldade = %d", i+1);
- P = LP->Hash[i];
- while(P)
- {
- VerPergunta(P);
- P=P->prox;
- }
- }
- /*adicionar para ver por dificuldade*/
- }
Advertisement
Add Comment
Please, Sign In to add comment