Statistics from the n results of the students in the average number of students below, and returns this value as a function of the number, stored in the average storage unit referred to in the parameter aver

#include <stdio.h> 
int Fun (int K, * AVER a float, a float * Grade) 
{ 
	a float SUM = 0.0; 
	int COUNT = 0; 
	for (int I = 0; I <K; I ++) 
		SUM + Grade = [I ]; 
	* AVER = SUM / K; 
	for (int J = 0; J <K; J ++) 
		IF (Grade [J] <* AVER) 
			COUNT ++; 
	return COUNT; 
} 
void main () 
{ 
	int K, I; 
	a float Grade [81], AVER; 
	the printf ( "Please iNPUT student_num:"); 
	Scanf ( "% d", & K); 
	for (I = 0; I <K; I ++) 
	{ 
		the printf ( "enter% d of students results: ", I +. 1); 
		Scanf ("% F ", Grade I +); 
	} 
	the printf (" lower than average number of students is: D% \ n-", Fun (K, & AVER, Grade)); 
}

  

Guess you like

Origin www.cnblogs.com/-slz-2/p/11262957.html