#include <stdio.h>
int main()
{
int i,n,count;
double score,total;
printf("Enter n:\n");
scanf("%d",&n);
total=0;
count=0;
for(i=1;i<=n;i++){
printf("Enter score #%d:",i);
scanf("%lf",&score);
total=total+score;
if(score>60){
count++;
}}
if(n!=0){
printf("Average = %.2f\n",total/n);
}
else if(n==0){
printf("Average = 0\n");
}
printf("Pass = %d",count);
return 0;
}
诶嘿嘿我来啦!刚刚步入分支结构keep on!