Ho provato così... non ci sono errori di compilazione, ma non riesce...
Dove sbaglio???
#include <stdio.h>
#include <stdlib.h>
void ordinamento();
int main() {
int g[3];
int m[3];
int a[3];
int i;
for (i=0; i<3; i++)
{
printf ("Inserisci la data %d in formato gg/mm/aaaa\n", i);
scanf("%2d/%2d/%4d", &g[i], &m[i], &a[i]);
}
ordinamento(a, m, g);
for (i=0; i<5; i++){
printf("%2d/%2d/%4d", &g[i], &m[i], &a[i]);
printf("\n");
}
system("pause");
return 0;
}
void ordinamento(int *a, int *m, int *g)
{
int h, k;
int temp1, temp2, temp3;
for(h=0; h<2; h++);{
for (k=0; k<2-h; k++){
if (a[k]>a[k+1]){
temp1 = a[k];
a[k] = a[k+1];
a[k+1] = temp1;
temp2 = m[k];
m[k] = m[k+1];
m[k+1] = temp2;
temp3 = g[k];
g[k] = g[k+1];
g[k+1] = temp3;
}
if (a[k]=a[k+1]){
if (m[k]>m[k+1]){
temp1 = m[k];
m[k] = m[k+1];
m[k+1] = temp1;
temp2 = g[k];
g[k] = g[k+1];
g[k+1] = temp2;
}}
if (a[k]=a[k+1]){
if (m[k]=m[k+1]){
if (a[k]>a[k+1]){
temp2 = g[k];
g[k] = g[k+1];
g[k+1] = temp2;
}}}}}}