Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
29553 | lnx | 求平均年龄 | C++ | Accepted | 0 MS | 240 KB | 222 | 2023-10-31 18:51:08 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,a; int b=0; cin>>n; for(int i=0;i<n;i++){ cin>>a; b+=a; } double aver=1.0*b/n; cout << fixed << setprecision(2) << aver; return 0; }