关于C语言编程德问题

来源:百度知道 编辑:UC知道 时间:2024/06/11 14:53:17
int index,score[SIZE];
scanf("%d",&scaore[index];
这里的score[SIZE]怎么变成了scaore[index]了?
scaore[index]这个也是数组吗?怎么前面有定义?
scaore[index]是怎么来哒?
scaore[index]

scanf("%d",&scaore[index]
这句话是读入10个数。
读德10个数放哪里?
scaore[index]这个里面吗?这个scaore[index]是数组吗?
scanf("%d",&scaore[index]读入10个数,怎么不写成
scanf("%d",&scaore[SIZE]
int index,跟scaore[index]这个有啥关系。。。

score[size] 是int数组,第一行不是有定义嘛。
至于后面的score[index] 里面的index只是个数字,应该这样写才对
int index,score[SIZE];
index=0;
scanf("%d",&score[index]);

记得给变量赋初值。
------------
score[]是个int数组,要想这个数组存十个数,必须用个循环才行。
像你写的这样一句,当然只能存一个值了,score[index]这里的index是几,值就存在score[]几里。
要想存10个数就应该这样:
index=0
for (index;index<10;index++)
{
scanf("%d",&score[index];
}

这样10值就存到了score[0]-score[9]中了。