/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include struct rep_fecha { unsigned int d ; unsigned int m ; unsigned int a ; }; /* fechas (por ejemplo, con las fechas 10/10/2022, 15/5/2022 y 20/11/1992) */ int main() { //Se crea un arreglo de elementos de tipo rep_fecha y se inicializa con el arreglo de fechas unsigned int n=3; rep_fecha fechas[]={{10,10,2022},{15,5,2022},{20,11,1992}}; /*Forma alternativa que esta bien fechas[0]={10,10,2022}; fechas[1]={15,5,2022}; fechas[2]={20,11,1992}; */ /*Esta forma esta mal porque intento ingresar a la posicion 3 que no existe A su vez, el tipo de dato no es el mismo, porque fechas[3] es un elemento de tipo rep_fecha no arreglo fechas[3]={{10,10,2022},{15,5,2022},{20,11,1992}};*/ //Ordenar usando selectionsort for (unsigned int i = 0; i < n-1; i++) { unsigned int min_idx = i; for (unsigned int j = i+1; j