十个评委打分,去最低和最高,求均分

//十个评委打分,去最低和最高,求均分
#include<stdio.h>
int main()
{
int score,sum=0,i,ave;
int max=-32768,min=32767;
for(i=0;i<10;i++)
{
printf("Input %d score: ",i);//别写成printf("Iput i score:");
scanf("%d",&score);
sum+=score;
if(max<score)
max=score;
if(min>score)
min=score;
}
ave=(sum-max-min)/8;
printf("Cancelled score are:%d %d\n",max,min);
printf("Final score is:%d\n",ave);
return 0;
}

 

posted @ 2012-03-26 14:48  加拿大小哥哥  阅读(487)  评论(0编辑  收藏  举报