求n个数中偶数的平均数
#include <stdio.h>
void main(){
int t,i,average,sum=0,n,count=0;
printf("How many data you want to input:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Input the %d data:",i+1);
scanf("%d",&t);
if(t%2==0){
sum+=t;
count++;
}
}
average=sum/count;
printf("There are %d even data in all!",count);
printf("\nEven data average=%d",average);
getch();
}