错误太多了,建议这样
#include <stdio.h>
int main()
{
int i;
float a[10], sum, ave;
printf("Input ten numbers:\n");
for (i=0;i<10;i++)
scanf("%f",&a[i]);
sum = 0;
for (i=0;i<10;i++)
sum += a[i];
ave = sum/10;
printf("Sum = %f\nAverage = %f\n",sum,ave);
}
#include <stdio.h>
int main()
{
int i;
float a[10], sum, ave;
printf("Input ten numbers:\n");
for (i=0;i<10;i++)
scanf("%f",&a[i]);
sum = 0;
for (i=0;i<10;i++)
sum += a[i];
ave = sum/10;
printf("Sum = %f\nAverage = %f\n",sum,ave);
}