# define N 100
Void main (void)
{
Int I, j, a, k, n, m;//n is the number of students, I j is the subscript
Int score [N] [3].
Float aver [N].
Float t;
int sum=0;
Printf (" please input to input result of student number \ n \ r ");
The scanf (" % d ", & amp; N);
Printf (" please input the students in turn three grades \ n \ r ");
for(i=0; i
for(j=0; j<3; J++)
The scanf (" % d ", & amp; Score [I] [j]);
}
for(i=0; i
{
Sum=0;
for(j=0; j<3; J++)
The sum +=score [I] [j];
Aver [I]=sum/3.0;
}
for(i=0; i
k=1;
for(j=i+1; j
If (aver [k]
}
If (k!=I)
{
T=aver [I]; Aver [I]=aver [k]. Aver [k]=t;
for(m=0; m<3; M++)
{
A=score [I] [m].
Score [I] [m]=score [k] [m].
Score [k] [m]=a;
}
}
}
Printf (" the sorted score is: \ n ");
for(i=0; i
for(j=0; j<3; J++)
Printf (" % d ", score [I] [j]);
Printf (" % 2 f \ n ", aver [I]);
}
}
Also sent a name information input and output don't know what to do for bosses to solve
CodePudding user response:
You can define a 2 d array such as name [100] [30] to store nameCodePudding user response:
I know that define an array but won't after the==CodePudding user response: