第九周项目四:大奖赛计分

#include <iostream>
using namespace std;
int main()
{
    do
    {
        char key;
        int n;
        double min = 10, max = 0, sum = 0, x;
        cout << "请输入选手的成绩(0~10)" << endl;
        for (n = 1; n <= 10; n++)
        {
            cout << "第" << n << "位评委给分:";
            cin >> x;
            sum = sum + x;
            if (max <= x)
                max = x;
            if (min >= x)
                min = x;
        }
        cout << "减去一个最高分:" << max << ",  " <<
             "减去一个最低分:" << min << "." << endl;
        sum = (sum - max - min) / 8;
        cout << "当前选手的最后得分是:" << sum << endl;
        cout << "********************SUCCESS********************" << endl;
        cout << "按 N 退出,其他键继续...Y"<<endl;
        cin >> key;
        if (key == 'N')              break;
        else
            continue;
        cout<<endl;
    }
    while (1);
    return 0;
}

第九周项目四:大奖赛计分_第1张图片

你可能感兴趣的:(第九周项目四:大奖赛计分)