ACM-Teleportation

我的代码:

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;
}

posted @ 2018-05-12 16:31  兰翔  阅读(230)  评论(0)    收藏  举报