提交时间:2024-09-22 21:56:55
运行 ID: 51615
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double sum = 0.0; for (int i = 0; i < n; i++) { double num; cin >> num; sum += num; } double average = sum / n; cout<<sum<<" "<<fixed<<setprecision(5)<<average; return 0; }