Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
145148 李昊阳 07切比雪夫距离 C++ Compile Error 0 MS 0 KB 270 2026-01-25 09:07:52

Tests(0/0):


Code:

#include <iostream> #include <algorithm> #include <cmath> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int x = abs(a - c); int y = abs(b - d); int d = max(dx, dy); cout << d << endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:9: error: redeclaration of 'int d'
     int d = max(dx, dy);
         ^
Main.cc:6:18: note: 'int d' previously declared here
     int a, b, c, d;
                  ^
Main.cc:10:17: error: 'dx' was not declared in this scope
     int d = max(dx, dy);
                 ^
Main.cc:10:21: error: 'dy' was not declared in this scope
     int d = max(dx, dy);
                     ^
Main.cc:8:9: warning: unused variable 'x' [-Wunused-variable]
     int x = abs(a - c);
         ^
Main.cc:9:9: warning: unused variable 'y' [-Wunused-variable]
     int y = abs(b - d);
         ^