题目链接:http://codeforces.com/problemset/problem/336/A
1、刚开始因为没有注意到x1<x2的限制,以为答案是special judge的,结果WA了一次,一定要仔细啊~
#include <cstdio>
using namespace std;
int main()
{
int x,y,x1,y1,x2,y2,tempx,tempy,ans;
while(scanf("%d%d",&x,&y)==2){
if(x<0)tempx=-x;
else tempx=x;
if(y<0)tempy=-y;
else tempy=y;
ans=tempx+tempy;
if(x>0&&y>0)
printf("%d %d %d %d\n",0,ans,ans,0);
if(x>0&&y<0)
printf("%d %d %d %d\n",0,-ans,ans,0);
if(x<0&&y>0)
printf("%d %d %d %d\n",-ans,0,0,ans);
if(x<0&&y<0)
printf("%d %d %d %d\n",-ans,0,0,-ans);
}
return 0;
}