當前位置:編程學習大全網 - 電腦編程 - C語言 評委打分問題

C語言 評委打分問題

#include?<stdio.h>

int?main(int?argc,?char*?argv[]){

float?max?=?0.0;//最高分

float?min?=?0.0;//最低分

float?sum?=?0.0;?//總分

float?temp?=?0.0;//臨時存儲每次輸入?

short?int?n?=?0;//評委數

short?int?i?=?0;

scanf("%d",?&n);?

for(i?=?0;?i?<?n;?i++){

scanf("%f",?&temp);

if(temp?>?max)

max?=?temp;

if(temp?<?min?||?i?==?0)

min?=?temp;

sum?+=?temp;? ?

}?

printf("%.2f",(sum-max-min)/(n-2));?

return?0;?

}

  • 上一篇:寶馬三系加裝原廠後攝像頭如何編程
  • 下一篇:擴展會話10 83什麽意思
  • copyright 2024編程學習大全網