#include<iostream>
#include<queue>
#include<cstring>
using namespace std;
int a[1000010];
bool cmp(int a,int b){
	return a>b;
}
struct node{
	int a,b;
	node (int a,int b)
	{
		this->a=a;
		this->b=b;
	}
	bool operator <(const node &w)const
	{
		if(a!=w.a)
		return a>w.a;
		else
		return b>w.b;
	}
}; 
int main(){
	int n,m;
	int i=0;
	priority_queue<node>Q;
	while(scanf("%d%d",&n,&m)&&(n||m)){
		Q.push(node(n,m));	
	} 
	while(!Q.empty())
	{
		cout<<Q.top().a<<' '<<Q.top().b<<endl;
		Q.pop();
	}
	return 0;
} 
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐