当前位置:网站首页>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;
}
边栏推荐
- Acwing: the 56th weekly match
- Problem - 1646C. Factorials and Powers of Two - Codeforces
- Kubernetes cluster deployment
- SF smart logistics Campus Technology Challenge (no T4)
- SQL快速入门
- Basic principles of video compression coding and audio compression coding
- Hbuilder X格式化快捷键设置
- 两个礼拜速成软考中级软件设计师经验
- CMake速成
- Problem - 922D、Robot Vacuum Cleaner - Codeforces
猜你喜欢
视频压缩编码和音频压缩编码基本原理
Discussion on QWidget code setting style sheet
Simply try the new amp model of deepfacelab (deepfake)
Spark独立集群动态上线下线Worker节点
Chapter 6 rebalance details
The concept of spark independent cluster worker and executor
拉取分支失败,fatal: ‘origin/xxx‘ is not a commit and a branch ‘xxx‘ cannot be created from it
软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客
第6章 Rebalance详解
Solve the single thread scheduling problem of intel12 generation core CPU (II)
随机推荐
Summary of game theory
Advancedinstaller installation package custom action open file
Investigation report of bench type Brinell hardness tester industry - market status analysis and development prospect prediction
Research Report on market supply and demand and strategy of China's four seasons tent industry
Ffmpeg command line use
OneForAll安装使用
Codeforces Round #803 (Div. 2)A~C
JS encapsulates the method of array inversion -- Feng Hao's blog
【锟斤拷】的故事:谈谈汉字编码和常用字符集
第6章 DataNode
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
简单尝试DeepFaceLab(DeepFake)的新AMP模型
JS time function Daquan detailed explanation ----- AHAO blog
使用jq实现全选 反选 和全不选-冯浩的博客
js时间函数大全 详细的讲解 -----阿浩博客
Simple records of business system migration from Oracle to opengauss database
ffmpeg命令行使用
第一章 MapReduce概述
力扣leetcode第 280 场周赛