Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56755 | 许兴平 | 求平均年龄 | C++ | Accepted | 0 MS | 248 KB | 256 | 2024-11-15 19:23:07 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,times,cishu; double result=0.0; cin>>times; cishu=times; while(times>=1){ cin>>a; result+=a; times-=1; } cout<<fixed<<setprecision(2)<<1.0*result/cishu; return 0; }