#include
main()
{
int avg,i,sum=0,a[11];
printf("请输入十个整数\n");
for(i=1;i<=10;i++)
{
printf("请输入第%d个整数: ",i);
scanf("%d",&a[i]);
sum+=a[i];
}
avg=sum/10;
printf("平均数为:%d\n",avg);
sum=0;
for(i=1;i<=10;i++)
{
if(a[i]>avg) sum++;
}
printf("大于平均数的数个数为:%d个\n",sum);
}
#include
int main()
{
int sum =0;
int average = 0;
int n = 0;
int i = 0;
int array1[10]={0,10,14,30,10,13,12,11,15,16};
for (i = 0;i<10;i++)
{
sum += array1[i];
}
average = sum/10;
for (i =0;i<10;i++)
{
if (array1[i]>average)
{
n ++;
}
}
printf("sum = %d\n",sum);
printf("average = %d\n",average);
printf("n = %d\n",n);
return 0;
}