我的代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x,y;
cin>>a>>b>>x>>y;
int count1,count2,count3;
count1 = abs(b-a);//直接运
count2 = abs(x-a)+abs(b-y);
count3 = abs(y-a)+abs(b-x);
int MIN;
MIN = count1<count2? count1:count2;
MIN = MIN<count3? MIN:count3;
cout<<MIN;
}