论代码的简洁。
#include <iostream>
using namespace std;
int main()
{
int maxx,maxy,minx,miny,x,y;
while(cin >> x >> y && (x || y))
{
maxx = minx = x;
maxy = miny = y;
while(cin >> x >> y && (x || y))
{
if(x < minx)
minx = x;
if(x > maxx)
maxx = x;
if(y < miny)
miny = y;
if(y > maxy)
maxy = y;
}
cout << minx << ' ' << miny << ' ' << maxx << ' ' << maxy << endl;
}
/*int x[1000],y[1000],maxx,maxy,minx,miny;
while(1)
{
for(int m = 0;;m++)
{
cin >> x[m] >> y[m];
if(m == 0)
{
maxx = minx = x[m];
maxy = miny = y[m];
}
if(x[m] == 0 && y[m] == 0)
{
if(m != 0)
cout << minx << ' ' << miny << ' ' << maxx << ' ' << maxy << endl;
break;
}
if(x[m] < minx)
minx = x[m];
if(x[m] > maxx)
maxx = x[m];
if(y[m] < miny)
miny = y[m];
if(y[m] > maxy)
maxy = y[m];
}
if(x[0] == 0 && y[0] == 0)
break;
}*/
return 0;
}