为什么这个我在VC上能运行,可到这就不行呢
#include <stdio.h>
int total(int score[]);
int high(int score[]);
int low(int score[]);
int average(int score[]);
void sorting(int score[]);
int main()
{
const int N=10;
int score[N]={67,98,75,63,82,79,81,91,66,84};
printf("total:%d\n",total(score));
printf("high:%d\n",high(score));
printf("low:%d\n",low(score));
printf("average:%d\n",average(score));
sorting(score);
return 0;
}
int total(int score[])
{
int i,sum=0;
for(i=0;i<10;i++)
{
sum+=score[i];
}
return sum;
}
int high(int score[])
{
int i,max=score[0];
for(i=1;i<10;i++)
{
if(score[i]>max)
{
max=score[i];
}
}
return max;
}
int low(int score[])
{
int i,min=score[0];
for(i=1;i<10;i++)
{
if(score[i]<min)
{
min=score[i];
}
}
return min;
}
int average(int score[])
{
int i,sum=0,Ave;
for(i=0;i<10;i++)
{
sum+=score[i];
}
Ave=sum/10;
return Ave;
}
void sorting(int a[])
{
int i,j, t;
for(i=0;i<9;i++)
{
for(j=0;j<10-i;j++)
{
if(a[j]<a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]= t;
}
}
}
for(i=0;i<10;i++)
{
printf("%d\t",a[i]);
}
}