Diferencia entre revisiones de «Simulación de algoritmos/Ordenamiento/Externo/Mezcla Equilibrada»

Contenido eliminado Contenido añadido
Línea 44:
#include <string.h>
 
//#define ARCHIVO_ORIGEN "prueba.txt" //Ahora toma el nombre de archivo desde el argumento del programa
#define NUM_ELEM 35
 
Línea 94:
int i;
 
fuente=fopen(ARCHIVO_ORIGENargv[1], "r");
if (fuente==NULL) {
printf("\n--No se pudo habrir el archivo de entrada: %s--\n", ARCHIVO_ORIGENargv[1]);
exit(1);
}
Línea 115:
//correr el algoritmo
mezclaEquilibrada(ARCHIVO_F, ARCHIVO_F1, ARCHIVO_F2, ARCHIVO_F3);
printf("\nPresione una tecla para continuar...\n"); //mensaje que reemplaza el usado por Windows en system("pause");
 
getchar(); //Es portable. En cambio system("pause"); no funciona en GNU/Linux
system("PAUSE");
return 0;
}
Línea 370:
printf("Archivo %d (estado: %d):\n", i, abierto[i]);
for(j=0; j<NUM_ELEM; j++){
if( printf("%02df[i][j]!=-1) ",&& (f[i][j] != f[i][j-1]); ){ //Evita los -1, y no imprime los repetidos
printf("%2d ", f[i][j]);
}
}
printf("\n");
Línea 378 ⟶ 380:
}
printf("---\n\n\n");
printf("\nPulse una tecla para continuar...\n");
system("PAUSE");
getchar();
}