1 条题解

  • 1
    @ 2026-8-18 15:55:07

    #include <bits/stdc++.h> using namespace std;

    int main() { int n, a[15]; double s = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; s = s + a[i]; } double AVE = 1.0 * s / n; cout << "AVE=" << fixed << setprecision(1) << AVE << endl; for (int i = 1; i <= n; i++) { if (a[i] > AVE) { cout << i << ":" << a[i] << " "; } } return 0; }

    • 1

    【入门】找找谁的身高超过全家的平均身高

    信息

    ID
    30146
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    116
    已通过
    55
    上传者