Home > Back-end >  Bosses help children
Bosses help children

Time:05-13

Made a high score but bosses genuflect is begged to guide student number and name does not exchange with achievement

CodePudding user response:

Suggest post code,

CodePudding user response:

#include
#include
#include
Int main ()
{
Int I=0, j=0, t, p, k;
Int c [3] [4];
Char name [3], [100] ID [3] [15], w [3] [100].


Printf (" please input the name of the three students first \ n ");
for(i=0; I<3; I++)
The scanf (" % s ", name [I]);
Printf (" please enter the three students student id \ n ");
for(i=0; I<3; I++)
The scanf (" % s ", ID [I]);
Printf (" please enter the student achievement ");


For (I=0; i <3; I++)//I on behalf of the students, j represents the subject, first with the student to carry on the systemic circulation
For (j=0; j <4. J++)//subject result number input
The scanf (" % d ", & amp; C [I] [j]);
For (j=0; j <4. J++)
//threshold of circulation{
for(i=0; I<2; I++)
{
K=I;
For (p=I + 1; p<3; P++)
If (c [p] [j] K=p;
T=c [k] [j]; C [k] [j] [I] [j]=c; C [I] [j]=t;
Strcpy (w, name [I + 1)); Strcpy (name, [I + 1] name [I]); Strcpy (name [I], w);
Strcpy (w, ID [I]); Strcpy (ID [I], ID [I + 1)); Strcpy (ID [I + 1), w);
}
The switch (j)
{
Case 0:
Printf (" [% s] % s points for language result: % d \ n ", ID [2], the name [2], [2] c [0]). break;
Case 1:
Printf (" [% s] points for the math scores of % s: % d \ n ", ID [2], the name [2], c [2] [1]). break;
Case 2:
Printf (" [% s] % s for the highest record in English: % d \ n ", ID [2], the name [2], c [2] [2]). break;
Case 3:
Printf (" [% s] % s

CodePudding user response:

Case 3:
Printf (" [% s] science scores points for % s: % d \ n ", ID [2], the name [2], c [2] [3]). break;
}
}
return 0;
}
  • Related