当前位置:网站首页>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;
}边栏推荐
- Browser print margin, default / borderless, full 1 page A4
- Advancedinstaller installation package custom action open file
- Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
- Research Report of desktop clinical chemical analyzer industry - market status analysis and development prospect prediction
- 第6章 Rebalance详解
- Chapter 2 shell operation of hfds
- Tencent interview algorithm question
- (lightoj - 1369) answering queries (thinking)
- Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
- 第五章 Yarn资源调度器
猜你喜欢

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

QT implementation fillet window

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

提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)

本地可视化工具连接阿里云centOS服务器的redis

解决Intel12代酷睿CPU单线程只给小核运行的问题

Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)

第5章 NameNode和SecondaryNameNode

<li>圆点样式 list-style-type

Cmake Express
随机推荐
LeetCode 1447. Simplest fraction
Codeforces Round #800 (Div. 2)AC
业务系统兼容数据库Oracle/PostgreSQL(openGauss)/MySQL的琐事
Spark的RDD(弹性分布式数据集)返回大结果集
CMake速成
Click QT button to switch qlineedit focus (including code)
Cmake error: could not create named generator visual studio 16 2019 solution
(lightoj - 1354) IP checking (Analog)
Market trend report, technical innovation and market forecast of China's desktop capacitance meter
Basic principles of video compression coding and audio compression coding
图像处理一百题(11-20)
LeetCode 1560. The sector with the most passes on the circular track
Chapter 7__ consumer_ offsets topic
Simply try the new amp model of deepfacelab (deepfake)
Market trend report, technological innovation and market forecast of China's double sided flexible printed circuit board (FPC)
SQL快速入门
Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
Hbuilder X格式化快捷键设置
(lightoj - 1236) pairs forming LCM (prime unique decomposition theorem)
js时间函数大全 详细的讲解 -----阿浩博客