#include
#include
int num(float *avg, int n, float from, float to){
int i;
int num = 0;
for(i=0;iif(to==100)
if(avg[i]>=from&&avg[i]<=to)
num++;
else
if(avg[i]>=from&&avg[i]num++;
}
return num;
}
int main(){
const int N = 10;
int i;
float avg[N];
float maths,linal,pys,cpg;
printf("Input %d student's score(four classes):\n",N);
for(i=0;iscanf("%f%f%f%f",&maths,&linal,&pys,&cpg);
avg[i] = (maths+linal+pys+cpg)/4.0;
}
printf("\nAverage score: ");
for(i=0;iprintf("%0.2f ",avg[i]);
printf("\n");
printf("Number of peopeo with average score between 0 and 60: %d\n",num(avg,N,0,60));
printf("Number of peopeo with average score between 60 and 70: %d\n",num(avg,N,60,70));
printf("Number of peopeo with average score between 70 and 80: %d\n",num(avg,N,70,80));
printf("Number of peopeo with average score between 80 and 90: %d\n",num(avg,N,80,90));
printf("Number of peopeo with average score between 90 and 100: %d\n",num(avg,N,90,100));
system("pause");
return 1;
}