Submission #2697310
Source Code Expand
#include <iostream> #include <string> #include <math.h> using namespace std; int main(){ int N,x,y double max_len=0.0; cin >> N; for(int i = 0;i < N;i++){ cin >> x >> y; double length = sqrt(pow(x,2) + pow(y,2)); max_len = max(max_len,length); } cout << max_len << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 2点間距離の最大値 ( The longest distance ) |
User | Bondo416 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 355 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:5: error: expected initializer before ‘double’ double max_len=0.0; ^ ./Main.cpp:11:21: error: ‘y’ was not declared in this scope cin >> x >> y; ^ ./Main.cpp:13:9: error: ‘max_len’ was not declared in this scope max_len = max(max_len,length); ^ ./Main.cpp:15:13: error: ‘max_len’ was not declared in this scope cout << max_len << endl; ^