Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
127712 | 王培用 | 计算平均数 | C++ | Accepted | 1 MS | 268 KB | 410 | 2025-07-28 17:29:08 |
#include <bits/stdc++.h> using namespace std ; int main() { int n; n = 5; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int sum = 0; for (int i = 0; i < n; i++) { sum = sum + a[i]; } double j = sum * 1.0 / n; printf("%.2f", j); cout << endl; for (int c = 0; c < 5; c++) { if (a[c] > j) { cout << a[c] << " "; } } return 0; }