Current location - Training Enrollment Network - Mathematics courses - Computational mathematical programming
Computational mathematical programming
The procedure is as follows: See the attached figure for the results:

# contains "stdio.h"

const? int? n = 10;

Invalid? Master ()

{

Floating? Student [n];

int? I,add = 0;

floatmax,min,average

for(I = 0; I & ltn;; i++)

{

Printf ("Please enter the math scores of %d students (* *10 students):", I+1);

Scanf("%f ",& student [me]);

}

max = min = student[0];

for(I = 0; I & ltn;; i++)

{?

if(student[i]>max)max = student[I];

If (student [me] <; min)min = student[I];

Add+= student [I];

}

Average value = add/(float) n;

Printf ("The highest and lowest average scores of these students are:% 2.0f \ t% 2.0f \ t% 2. 1f", max, min, average);

}