为什么不对,求解答
#include <stdio.h>
int abc()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int sum,i;
float avr;
for(i=0;i<9;i++)
sum+=score[i];
avr=sum/10;
printf("zong%d\n",sum);
printf("pin%f\n",avr);
return 0;
}
int de()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int k,h,temp;
for(k=9;k>0;k--)
{
for(h=0;h<=k;h++)
{
if(score[h]<score[h+1])
{temp=score[h+1];
score[h+1]=score[h];
score[h]=temp;
}
}
}
printf("jiangxu%d\n",score[h]);
printf("max%d\n",score[0]);
printf("lii%d\n",score[9]);
return 0;
}
int main()
{abc();
de();
return 0;
}