為什么我的編譯器說,在rank函數(shù)的輸出語句中的score錯誤?
void rank(int score[10])
{
??? int w,u,ag,j;
??? for(w=9;w>=0;w--)
??? {
??????? for(u=0;u<=w;u++)
??????? {
??????????? if(score[u]<score[u+1])
??????????? {
??????????????? ag=score[u];
??????????????? score[u]=score[u+1];
??????????????? score[u+1]=ag;
??????????? }
??????? }
??? }
??? for(j=0;j<10;j++)
??? {
??????? printf("%d ",score(j));
??? }
}
int main()
{
??? int score[]={67,98,75,63,82,79,81,91,66,84};
??? rank (score);
??? return 0;
}
2017-01-22
錯誤信息:
第18行“score”不能作為函數(shù)使用。score是數(shù)組,要用方括號。
第18行“printf”未聲明。這是因為沒寫頭文件#include<stdio.h>。