Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void compraSegura(lista cab, string autor)
- {
- lista aux;
- nodoLibro *auxl,*temp,*mayorNota, *temp2;
- if(cab==NULL)
- cout << "Lista vacia" << endl;
- else
- {
- aux=cab;
- while(aux!=NULL)
- {
- auxl=aux->libro;
- while(auxl!=NULL)
- {
- if(auxl->autor==autor)
- {
- if(temp==NULL)
- temp=auxl;
- else
- {
- temp2=temp;
- temp=auxl;
- if(temp->nota>temp2->nota)
- mayorNota=temp;
- }
- }
- auxl=auxl->siguiente;
- }
- aux=aux->siguiente;
- }
- cout << "Libro con mejor critica: " << mayorNota->titulo << endl;
- cout << "Nota de critica: " << mayorNota->nota << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement