CodeForces 620A Professor GukiZ's Robot

水题

#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<vector>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;

int sx,sy;
int ex,ey;

int main()
{
    scanf("%d%d",&sx,&sy);
    scanf("%d%d",&ex,&ey);
    int ans;
    int lenx=abs(ex-sx);
    int leny=abs(ey-sy);
    ans=min(lenx,leny)+lenx-min(lenx,leny)+leny-min(lenx,leny);
    printf("%d\n",ans);
    return 0;
}

 

posted @ 2016-01-22 14:33  Fighting_Heart  阅读(194)  评论(0编辑  收藏  举报