大帅哥 • 6天前
using namespace std; int main(){ int x1,y1,x2,y2,a,b; cin>>x1>>y1>>x2>>y2; a=x1-x2; b=y1-y2;
if(a>=0 && b>=0)cout<<a+b;
else if(a<=0 && b<=0)cout<<(a+b)*(-1);
else if(a>=0 && b<=0)cout<<a-b;
else if(a<=0 && b>=0)cout<<b-a;
return 0; }
评论:
请先登录,才能进行评论