#include <stdio.h>
#define N 10
int main()
{
int i;
double a[N],sum=0.0;
sum=0.0;
printf("请输入成绩:\n");
for(i=0;i<N;i++)
scanf("%lf",&a[i]);
for(i=0;i<N;i++)
sum+=a[i];
printf("输出平均成绩:") ;
printf("%2.1f ",sum/N);
return 0;
}
//1 2 3 4 5 6 7 8 9 10——计算结果:5.5
标签:考试成绩,平均值,10,int,0.0,sum,计算,printf From: https://blog.51cto.com/u_15853130/5896619