#include <iostream> #include <iomanip> using namespace std; int main(){ int n; cin>>n; int m; int sum; double x; for(int i=0;i<n;i++){ cin>>m; x=x+m; sum+=m; } cout<<sum<<" "; cout<<fixed<<setprecision(5)<<x/n; return 0; }
标签:std,int,sum,均值,整数,include From: https://www.cnblogs.com/fushuxuan/p/17086678.html