#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;
}
#include <stdio.h>
你这个空格可能是全角的 换成半角的或者去掉就可以了