小白一名,自己找不出来,谁帮我看一下哪有错误?
#include<stdio.h>#define N 40;
int ReadScore(int score[]);
void DataSort(int score],int n);
void PrintScore(int score[],int n);
int main()
{
int n,score[N];
n=ReadScore(score);
printf("total students are:%d\n",n);
DataSort(score[],n);
printf("sorted scores:");
PrintfScore(score,n);
return 0;
}
int ReadScore(int score[])
{
int i=-1;
do{
i++;
printf("input score:");
scanf("%d",&score[i]);
}while(score[i]>=0);
return i;
}
void DataSort(int score[],int n)
int i,j,temp;
{
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(score[j]>score[i])
{
temp=score[j];
score[j]=score[i];
score[i]=temp;
}
}
}
}
void PrintScore(int score[],int n)
{
int i;
for(i=0;i<n;i++)
{
printf("%4d",score[i]);
}
printf("\n");
}