logo AlgoBeat OnlineJudge
登录 注册

题解

作者: Steven1356  ·  发布于 2026-09-26 17:03:38  ·  最后修改于 2026-09-26 17:07:39
已通过
审核员:Carey_chen HCl · 2026-09-26 17:07:39

依次相除,将结果加起来即为答案。

注意:要开 double!

#include<bits/stdc++.h>
using namespace std;
signed main(){
	int a;
	cin>>a;
	double x=0,y=0;
	for(int i=0;i<a;i++){
		double s;
		cin>>s;
		x+=s;
	}
	for(int i=0;i<a;i++){
		double s;
		cin>>s;
		y+=s;
	}
	cout<<fixed<<setprecision(6)<<y/x;
    return 0;
}

暂无评论

登录 后即可评论。