mirror of
https://github.com/hao14293/2021-Postgraduate-408.git
synced 2026-07-18 20:20:43 +08:00
Create 1063.计算谱半径.cpp
This commit is contained in:
15
PAT/PAT-B/CPP/1063.计算谱半径.cpp
Normal file
15
PAT/PAT-B/CPP/1063.计算谱半径.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int n, a, b;
|
||||
float max = 0.0;
|
||||
cin >> n;
|
||||
for(int i = 0; i < n; i++){
|
||||
cin >> a >> b;
|
||||
float temp = sqrt(a * a + b * b);
|
||||
if(temp > max) max = temp;
|
||||
}
|
||||
printf("%.2f", max);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user