Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40082 | wuxinyue | 求整数的和与均值 | C++ | Accepted | 0 MS | 256 KB | 240 | 2024-02-07 13:42:18 |
#include <bits/stdc++.h> using namespace std; int main(){ double n; cin>>n; int i=1; double sum = 0; while(i<=n){ double x; cin>>x; sum=sum+x; i++; } cout<<sum<<" "<<fixed<<setprecision(5)<<sum/n; return 0; }