AC

❤ · 发布于 2025-08-01 · 浏览 337 回复 0
#include <bits/stdc++.h>
using namespace std;
map<int,int> a;

int main() {
	int t;
	cin>>t;
	while(t!=-1) {
		if(a.find(t)==a.end()) {
			a[t]=0;
		}
		a[t]++;
		cin>>t;
	}
	cin>>t;
	while(t!=-1) {
		if(a.find(t)==a.end()) {
			a[t]=0;
		}
		a[t]++;
		cin>>t;
	}
	for(auto it=a.begin(); it!=a.end(); it++) {
		while((*it).second!=0) {
			cout<<(*it).first<<" ";
			(*it).second--;
		}
	}
	return 0;
}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复