Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
106939 | 周琨智 | 计算平均数 | C++ | Accepted | 1 MS | 272 KB | 381 | 2025-01-17 09:56:49 |
#include<bits/stdc++.h> using namespace std; int main() { int d; d = 0; int a[5]; double b; double s; s = 0; for (int i = 0; i <= 4; i++) { cin >> a[i]; } for (int i = 0; i <= 4; i++) { s = s + a[i]; } b = s / 5; printf("%.2f",b); cout<<endl; for (int i = 0; i<=4; i++) { if (a[i] > b) { cout << a[i] << " "; } } return 0; }