Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
29555 | lnx | 求整数的和与均值 | C++ | Accepted | 0 MS | 244 KB | 235 | 2023-10-31 18:51:51 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b=0; cin>>n; for(int i=0;i<n;i++){ cin>>a; b+=a; } double aver=1.0*b/n; cout<<b<<" "; cout << fixed << setprecision(5) << aver; return 0; }