#include <stdio.h> int main(){ double sum=0.0,avg=0.0; double score; double min_score=0.0,max_score=0.0; int n; if (scanf("%d",&n)!=EOF && n>2){ for (int i=0;i<n;i++){ if (scanf("%lf",&score)!=EOF){ sum+=score; if (i==0){max_score=score;min_score=score;} if (i>0){ if (score>max_score){max_score=score;} if (score<min_score){min_score=score;} } } } avg = (sum-max_score-min_score)/(n-2); printf("%.2f",avg); } else{ printf("input wrong"); } return 0; }
c语言编程练习题:7-121 作品评分
作者:yunjinqi
类别:编程
日期:2023-05-31 16:33:00
阅读:589 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/246
最新文章
系统当前共有 404 篇文章