PRoblem Link:http://139.129.36.234/problem.php?id=1206
12 5623 5613 100 012 340 00 0样例输出
12 10 23 5612 34 12 34提示
来源
2007年浙江大学计算机及软件工程研究生机试真题
AC code:
#include<iostream>#include<algorithm>#include<stdio.h>#include<map>#include<math.h>#include<string.h>#include<queue>#include<map>#include<stack>#include<vector>#include<set>#define LL long long#define exp 1e-9#define MAXN 1000010using namespace std;int main(){// freopen("D://in.txt","r",stdin); int x,y,minx,miny,maxx,maxy; while(scanf("%d%d",&x,&y)!=EOF) { if(x==0 && y==0) { break; } minx=maxx=x; miny=maxy=y; while(1) { scanf("%d%d",&x,&y); if(x==0 && y==0) break; minx=min(minx,x); miny=min(miny,y); maxx=max(maxx,x); maxy=max(maxy,y); } printf("%d %d %d %d/n",minx,miny,maxx,maxy); } return 0;}
新闻热点
疑难解答