当前位置:网站首页>7-4 harmonic average
7-4 harmonic average
2022-07-06 16:43:00 【HBUcs2020】
Record a very stupid mistake
n-- after n Finally changed to 0, I still use n To divide

#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
double sum=0;
int a=n;
while(n--)
{
double x;
cin>>x;
//printf(" %lf %lf\n",1/x,sum);
sum+=1/x;
}
//sum=sum/n;
//printf("%lf\n",sum/n);
printf("%.2f",1.0/(sum/a));
return 0;
}边栏推荐
- LeetCode 1560. The sector with the most passes on the circular track
- Chapter 6 rebalance details
- js时间函数大全 详细的讲解 -----阿浩博客
- Li Kou - 298th weekly match
- QT style settings of qcobobox controls (rounded corners, drop-down boxes, up expansion, editable, internal layout, etc.)
- Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
- 提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)
- Generate random password / verification code
- LeetCode 1557. The minimum number of points that can reach all points
- Acwing - game 55 of the week
猜你喜欢

Oneforall installation and use

去掉input聚焦时的边框

ByteDance new programmer's growth secret: those glittering treasures mentors

Chapter 5 namenode and secondarynamenode

我在字节跳动「修电影」

Submit several problem records of spark application (sparklauncher with cluster deploy mode)

Installation and configuration of MariaDB

Mp4 format details

Anaconda下安装Jupyter notebook

两个礼拜速成软考中级软件设计师经验
随机推荐
Study notes of Tutu - process
Codeforces round 797 (Div. 3) no f
One hundred questions of image processing (11-20)
LeetCode 1557. The minimum number of points that can reach all points
Codeforces - 1526C1&&C2 - Potions
Date plus 1 day
Research Report on market supply and demand and strategy of double drum magnetic separator industry in China
解决Intel12代酷睿CPU单线程调度问题(二)
The concept of spark independent cluster worker and executor
LeetCode 1984. Minimum difference in student scores
字节跳动新程序员成长秘诀:那些闪闪发光的宝藏mentor们
QT implementation fillet window
Installation and configuration of MariaDB
Simply try the new amp model of deepfacelab (deepfake)
力扣leetcode第 280 场周赛
SF smart logistics Campus Technology Challenge (no T4)
第6章 DataNode
(lightoj - 1236) pairs forming LCM (prime unique decomposition theorem)
Discussion on QWidget code setting style sheet
Double specific tyrosine phosphorylation regulated kinase 1A Industry Research Report - market status analysis and development prospect prediction