7-19 Windows消息队列

7-19 Windows消息队列,第1张

7-19 Windows消息队列
#include
#include
#include
using namespace std;
int n,y;
struct ele{
	string s;
	int x;
	bool operator<(const ele &a)const{
		return x>a.x;
	}
};
int main()
{
	cin>>n;
	string s1,s2;
	priority_queueq;
	for(int i=1;i<=n;i++)
	{
		cin>>s1;
		if(s1=="PUT")
		{
			cin>>s2>>y;
			q.push({s2,y});
		}
		else{
			if(!q.empty())
			{
				ele e=q.top();
				q.pop();
				cout<					
										


					

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5691645.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存