L1-068 调和平均 分数 10

// 2'4"
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    long double res = 0;
    for(int i = 1; i <= n; ++ i)
    {
        long double x;
        cin >> x;
        res += 1 / x;
    }
    res /= n;
    cout << fixed << setprecision(2) << 1 / res << endl;
    return 0;
}
posted @ 2024-08-16 21:02  Frodnx  阅读(15)  评论(0)    收藏  举报