为社么RE?

P5726 【深基4.习9】打分

coderzhx @ 2024-06-06 21:25:52

#include <iostream>
using namespace std;

long p = -66666;
long q = 88888;
double a[5];
double n;

double sum;

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        sum += a[i];

        if (a[i] > p) {
            p = a[i];
        }
        if (a[i] < q) {
            q = a[i];
        }

    }
    printf("%.2lf", (sum - (p + q)) / (n - 2) * 1.0);

    return 0;
}

by _czx6666_ @ 2024-06-06 21:27:07

@Geyijinnoip 数据范围不看吗?

double a[5000];

by _czx6666_ @ 2024-06-06 21:27:23

求关


by coderzhx @ 2024-06-06 21:32:01

@czx6666 哦,谢谢,A了啊


|