Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROTOTIPO
- void Mastiempo(listaP,int *, datos [], int, datos);
- MAIN
- case 8:
- system("CLS");
- if(emptyP(listaprioridad)==1){
- printf("Lista Vacia\n");
- system("PAUSE");
- } else{
- resetP(&listaprioridad);
- datos auxiliar;
- while(oosP(listaprioridad)==0 && mostrar_atendido(copyP(listaprioridad))==0)
- {
- forwardP(&listaprioridad);
- }
- *aux2 = 0;
- auxiliar = copyP(listaprioridad);
- arr = (datos*)malloc(sizeof(datos)*contar_total_atendidos(listaprioridad));
- forwardP(&listaprioridad);
- Mastiempo(listaprioridad,&aux2,arr,n,auxiliar);
- for(i=0;i<*aux2; i++){
- printf("%s\n",arr[i].nomb);
- }
- system("PAUSE");
- }
- break;
- FUNCION
- void Mastiempo(listaP P,int *aux2,datos arr[],int i, datos auxiliar){
- if(oosP(P)==1 || mostrar_atendido(copyP(P))==2){
- return;
- }
- else
- if(retorna_resta_horasmin(auxiliar) > retorna_resta_horasmin(copyP(P))){
- arr[i] = auxiliar;
- forwardP(&P);
- *aux2 = *aux2 + 1;
- }
- else if(retorna_resta_horasmin(auxiliar) == retorna_resta_horasmin(copyP(P))){
- arr[i+1]= copyP(P);
- *aux2 = *aux2 + 1;
- forwardP(&P);
- } else if(retorna_resta_horasmin(auxiliar)< retorna_resta_horasmin(copyP(P))){
- auxiliar = copyP(P);
- arr[i]= copyP(P);
- aux2=0;
- forwardP(&P);
- }
- Mastiempo(P,&aux2,arr,i,auxiliar);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement