题目描述
解题思路
函数 | 功能 |
---|---|
max(a, b) | 返回a, b中的最大值(a,b需同类型) |
hypot(x, y) | 返回 x 2 + y 2 \sqrt{x^2 + y^2} x2+y2 |
c++程序实现
#include <bits/stdc++.h>
using namespace std;
using gg = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
gg n, a, b;
double m = 0;
cin >> n;
while (cin >> a >> b){
m = max(m, hypot(a, b));
}
cout << fixed << setprecision(2) << m;
return 0;
}