Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.52 KB | None | 0 0
  1. PROTOTIPO
  2. void Mastiempo(listaP,int *, datos [], int, datos);
  3.  
  4. MAIN
  5. case 8:
  6.         system("CLS");
  7.         if(emptyP(listaprioridad)==1){
  8.             printf("Lista Vacia\n");
  9.             system("PAUSE");
  10.         } else{
  11.         resetP(&listaprioridad);
  12.         datos auxiliar;
  13.         while(oosP(listaprioridad)==0 && mostrar_atendido(copyP(listaprioridad))==0)
  14.         {
  15.             forwardP(&listaprioridad);
  16.  
  17.         }
  18.         *aux2 = 0;
  19.         auxiliar = copyP(listaprioridad);
  20.         arr = (datos*)malloc(sizeof(datos)*contar_total_atendidos(listaprioridad));
  21.         forwardP(&listaprioridad);
  22.         Mastiempo(listaprioridad,&aux2,arr,n,auxiliar);
  23.  
  24.  
  25.         for(i=0;i<*aux2; i++){
  26.             printf("%s\n",arr[i].nomb);
  27.         }
  28.         system("PAUSE");
  29.         }
  30.         break;
  31.  
  32.  
  33.  
  34.  
  35.  
  36. FUNCION
  37.  
  38. void Mastiempo(listaP P,int *aux2,datos arr[],int i, datos auxiliar){
  39. if(oosP(P)==1 || mostrar_atendido(copyP(P))==2){
  40.     return;
  41. }
  42. else
  43.     if(retorna_resta_horasmin(auxiliar) > retorna_resta_horasmin(copyP(P))){
  44.         arr[i] = auxiliar;
  45.         forwardP(&P);
  46.         *aux2 = *aux2 + 1;
  47.  
  48.  
  49.     }
  50.     else if(retorna_resta_horasmin(auxiliar) == retorna_resta_horasmin(copyP(P))){
  51.         arr[i+1]= copyP(P);
  52.         *aux2 = *aux2 + 1;
  53.         forwardP(&P);
  54.  
  55.     } else if(retorna_resta_horasmin(auxiliar)< retorna_resta_horasmin(copyP(P))){
  56.         auxiliar = copyP(P);
  57.         arr[i]= copyP(P);
  58.         aux2=0;
  59.         forwardP(&P);
  60.  
  61.     }
  62.     Mastiempo(P,&aux2,arr,i,auxiliar);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement