2072:【例2.15】歌手大奖赛(2072: [example 2.15] singer Grand Prix)

【题目描述】

歌手大奖赛上6名评委给一位参赛者打分,6个人打分的平均分为9.6分;如果去掉一个最高分,这名参赛者的平均分为9.4分;如果去掉一个最低分,这名参赛者的平均分为9.8分;如果去掉一个最高分和一个最低分,这名参赛者的平均是多少?

【输入】

(无)

【输出】

使用按实数格式输出,保留2位小数。

%5.2f

【输入样例】

(无)

【输出样例】

(无)
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    double a = 9.6;
    cout <<setw(5)<< fixed << setprecision(2) << a;
}
————————

[Title Description]

At the singer Grand Prix, six judges rated one contestant, with an average score of 9.6; If one of the highest scores is removed, the average score of the contestant is 9.4; If the lowest score is removed, the contestant’s average score is 9.8; If one of the highest score and one of the lowest score are removed, what is the average score of this contestant?

[input]

(none)

[output]

Output in real format with 2 decimal places.

%5.2f

[input example]

(无)

[output example]

(无)
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    double a = 9.6;
    cout <<setw(5)<< fixed << setprecision(2) << a;
}