Home > Back-end >  Ask your c + + bosses
Ask your c + + bosses

Time:09-16

How do you do this programming problem? Make up a program (specific as shown in the figure below) had better use class, structure or array implementation, need to write some function called, thank you for your

CodePudding user response:

Save the children

CodePudding user response:

 
Typedef struct
{
Int scoreA, scoreB scoreC;
Int aver.
Char * name;
} student (NUM)


Input/output:
 
Void IO ()
{
for(i=0; IThe scanf (" % s ", & amp; Student [I] name);
The scanf (" % d, % d, % d ", & amp; Student [I]. ScoreA, & amp; Student [I]. ScoreB, & amp; Student [I] scoreC);
}


Sorting:
 
Void the sort () {
Int I, j, TMP.
for(i=1; ITMP=student [I] aver;
For (j=I; J> 0 & amp; & Student [j - 1] averStudent [j]. Journal of aver=student [j - 1] aver.
Student [j]. Journal of aver=TMP;
}
}


To find the lowest points in the for loop using if compared, selected maximum or minimum line

In language use a for loop to everyone's language result with the if or switch classification
  • Related