From e323cca9cea7f736f8480bb37d0cdac0b91af0e9 Mon Sep 17 00:00:00 2001 From: hao14293 Date: Sun, 25 Nov 2018 17:58:37 +0800 Subject: [PATCH] =?UTF-8?q?Create=201063.=E8=AE=A1=E7=AE=97=E8=B0=B1?= =?UTF-8?q?=E5=8D=8A=E5=BE=84.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PAT/PAT-B/CPP/1063.计算谱半径.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 PAT/PAT-B/CPP/1063.计算谱半径.cpp diff --git a/PAT/PAT-B/CPP/1063.计算谱半径.cpp b/PAT/PAT-B/CPP/1063.计算谱半径.cpp new file mode 100644 index 0000000..c264076 --- /dev/null +++ b/PAT/PAT-B/CPP/1063.计算谱半径.cpp @@ -0,0 +1,15 @@ +#include +#include +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; +}