Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Help me translate this C language program and write Chinese at the back. Thank you.
Help me translate this C language program and write Chinese at the back. Thank you.
This program is used to find the average value, maximum value and minimum value in the number 10.

# Define N 10 * Define the symbolic constant N= 1 1.

Master ()

{int a[N],I,max,min:N; * array a[N] is defined as storing 1 1 data, and several other integer variables are also defined.

clouble ave = 0; * Define bivariate ave to record the final average.

for(I = 0; I & ltn;; I++) * Start the loop,

{scanf("%d ",& ampa[I]); * Enter 1 1 integer data.

ave+= a[I]; * ave loop is equal to the sum of 1 1 data.

n = I; * This step is unnecessary. In fact, you can use the following N+ 1 instead of n.

max = min = a[0]; * give the maximum and minimum initial values.

for(I = 0; I & ltn;; I++) * Start calculating the maximum and minimum values in the loop.

{ if(a[I]& gt; max)max = a[I];

if(a[I]& lt; min)min = a[I]; }

ave/= n; * As mentioned earlier, ave is the sum of 1 1 data. Divided by n, it is 1 1, which is of course the average value.

printf("max=%d,min=%d,ave=%f," max,min,ave); * Output the average, maximum and minimum values on the screen.

}

This is a very basic C program. It's time to study computer:)