提交时间:2024-02-07 13:42:18
运行 ID: 40082
#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; }