#define _CRT_SECURE_NO_WARNINGS//VS要加,要不会报错
#include<stdio.h>
#define SIZE 10 //注意这里没有等号,后面没有分号
#define PAR 72
int main(void) {
int index, score[SIZE];
int sum = 0;
float average = 0;
printf("Enter %d golf score:\n", SIZE);
for (index = 0; index < SIZE; index++)
scanf("%d", &score[index]); //不要把&落下
printf("The score read in are as follows:\n");
for (index = 0; index < SIZE; index++)
printf("%5d", score[index]);
printf("\n");
for (index = 0; index < SIZE; index++)
sum += score[index];
average = (float)sum / SIZE;
printf("Sum of the score=%d,average=%.2f\n", score, average);
printf("That's a handicap of %.0f.\n", average - PAR);
return 0;
}