- 求平均年龄
1211212
- 2024-3-10 16:18:11 @
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
double a,sum;
sum = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a;
sum += a;
}
double ave = 1.0*sum / n;
cout << fixed << setprecision(4) << ave << endl;
}
0 comments
No comments so far...
Information
- ID
- 786
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 160
- Accepted
- 29
- Uploaded By