Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105922 | 胡海峰老师 | 07切比雪夫距离 | C++ | Accepted | 1 MS | 272 KB | 349 | 2025-01-14 22:14:52 |
#include <iostream> using namespace std; int main(){ int x1,y1, x2,y2; int deltx , delty; cin>>x1>>y1>>x2>>y2; deltx = x2-x1; delty = y2-y1; if(deltx<0) deltx = -deltx; if(delty<0) delty = -delty; if(deltx>delty) cout<< deltx; else cout<<delty; // delty > deltx or delty == deltx return 0; }