Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
35989 | lihaocheng | 求平均年龄 | C++ | Accepted | 0 MS | 252 KB | 230 | 2024-01-07 11:25:05 |
#include <iostream> using namespace std; int main() { int n; cin >>n; double sum=0; double age; for(int i=0;i<n;i++){ cin>>age; sum+=age; } printf("%.2f",sum/n); return 1; }