标题:这个何解?
取消只看楼主
minand
Rank: 2
等 级:论坛游民
帖 子:71
专家分:89
注 册:2011-3-16
结帖率:100%
 问题点数:0 回复次数:0 
这个何解?
#include<stdio.h>
#define SIZE 10
#define PAR 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 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 scores=%d,average=%.2f\n",sum,average);
printf("That's a handcap of %.0f.\n",average-PAR);
return 0;
}
中的scanf"%d",&score[index]),用的是index而不是SIZE呢?
是不是要将读入的数复制给index,所以用这个?那这个score又是干什么用的?


[ 本帖最后由 minand 于 2011-3-18 20:53 编辑 ]
搜索更多相关主题的帖子: index index 
2011-03-18 20:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334089-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.515477 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved