提交时间:2023-01-12 14:50:58
运行 ID: 17804
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,x,y,a1,b1,x2,y2; cin>>a>>b>>x>>y; int s1,s2; a1=min(a,b); b1=max(a,b); s1=b1-a1; x2=min(x,y); y2=max(x,y); s2=abs(a1-x2)+abs(b1-y2); int ans; ans=min(s1,s2); cout<<ans; return 0; }