Current location - Training Enrollment Network - Mathematics courses - C language uses arrays to calculate the scores of eight people in a class in Chinese and mathematics, and obtains the total score and the average score of qualified people.
C language uses arrays to calculate the scores of eight people in a class in Chinese and mathematics, and obtains the total score and the average score of qualified people.
# include & ltstdio.h & gt

int main()

{

Floating Chinese [8];

Floating point mathematics [8];

Float sum=0, average;

int count = 0;

Printf ("Please enter Chinese and math scores of 8 people: \ n");

for(int I = 0; I<8; i++)

Scanf("%f, %f ",& Chinese [i], & Math [I]);

for(int j = 0; j & lt8; j++)

Sum+= Chinese [I]+ Mathematics [I];

Average value = sum/16;

for(int k = 0; k & lt8; k++)

If ((Chinese [I]+ Mathematics [I])/2 > 60)count++;

Printf ("average total score: %f\n", average);

Printf ("Qualified number: %d\n", count);

Returns 0;

}