Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Mastiempo(listaP,int *aux2, datos arr[], int, datos); PROTOTIPO
- 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))==1)
- {
- forwardP(&listaprioridad);
- }
- 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;
- FIN MAIN
- FUNCION CONTAR TOTAL ATENDIDOS
- //* Contar total atendidos *//
- int contar_total_atendidos(listaP P){
- int i=0;
- while(oosP(P)==0){
- i++;
- }
- return i;
- }
- RECURSIVA
- void insertar_no_aten_medico(listaP *P){
- if(emptyP(*P)==1){
- printf("No hay pacientes para asignarle no atendido.\n");
- }
- else {
- resetP(P);
- datos auxiliar;
- auxiliar = copyP(*P);
- modifica_no_atendido(&auxiliar);
- noatendido(&auxiliar);
- supresP(P);
- while(oosP(*P)==0){
- forwardP(P);
- }
- insertP(P,auxiliar);
- printf("No atendido insertado con exito.\n");
- }
- }
- //* FIN Insertar NO ATENDIDO MEDICO. *//
- //* Quien espero mas tiempo RECURSIVA*//
- void Mastiempo(listaP P,int *aux2,datos arr[],int i, datos auxiliar){
- if(oosP(P)==1){
- 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);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement