本文共 1517 字,大约阅读时间需要 5 分钟。
求
#include大奖赛计分int main(){ int sum=0, i=1, t; while (i<=6) { t = 1; j = 1; while(j<=i) { t *= i; j++; } sum += t; i++; } printf("sum = %d\n", sum); return 0;}
#include进一步完善int main(){ int judgeNum, singerNum, j, s; double mark, sum, aver, max, min; scanf("%d %d", &judgeNum, &singerNum); s=1; while(s<=singerNum) { sum=0;max=0;min=10;j=1; do { scanf("%f",&mark); sum+=mark; if(max mark) min=mark; j++; } while(j<=judgeNum); aver = (sum-max-min)/(judgeNum-2); printf("%.3f\n", aver); s++; } return 0;}
#includeint main(){ int judgeNum, singerNum, j, s; double mark, sum, aver, max, min; scanf("%d %d", &judgeNum, &singerNum); s=1; while(s<=singerNum) { sum=0;max=0;min=10;j=1; do { scanf("%f",&mark); if(mark<0||mark>10) { continue; } sum+=mark; if(max mark) min=mark; j++; } while(j<=judgeNum); aver = (sum-max-min)/(judgeNum-2); printf("%.3f\n", aver); s++; } return 0;}