这个为什么第一个for循环scanf提取值之后就没反应,VS的
c语言吧
全部回复
仅看楼主
level 2
#include<stdio.h>
#define SIZE 10
#define FAR 72
int main(void)
{
int index, score[SIZE];
int sum = 0;
float average;
printf("Enter %d golf scores;\n", SIZE);
for (index = 0; index < SIZE; index++)
scanf("%d", &score[index]);
printf("The scores read in are as follow:\n");
for (index = 0; index < 10; index++)
printf("%5d", score[index]);
printf("\n");
for (index = 0; index < 10; index++)
sum += score[index];
average = (float)sum / 10;
printf("Sum of scores=%d,average=%.2f\n", sum, average);
printf("That's a handicap of %.0f.\n", average - FAR);
getchar();
return 0;
}
2016年01月19日 07点01分 1
level 2
for (index = 0; index < SIZE; index++)
scanf("%d", &score[index]);
这一段有问题吗,为什么这里输入值之后就只有输入的值后面完全运行不了,但是去掉这段,后面还可以运行的
2016年01月19日 07点01分 2
level 2
有大神在吗?
2016年01月19日 07点01分 3
1