提交时间:2024-11-10 11:30:40

运行 ID: 56293

#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; }