Advertisement
Guest User

Untitled

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