首页 > 其他 > 详细

ACM-Teleportation

时间:2018-05-12 17:20:38      阅读:223      评论:0      收藏:0      [点我收藏+]

技术分享图片

我的代码:

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

ACM-Teleportation

原文:https://www.cnblogs.com/lanxiang/p/9029076.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!