跳到正文

算法·理论

求帮助

zrx120818约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年4月6日
更新
2026年4月6日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1
C++
#include<bits/stdc++.h>
#include<map>
using namespace std;
map<string,int> m;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		string s;
		int x;
		cin>>s>>x;
		m[s]=x;
	}
	for(map<string,int>::iterator it=m.begin();it!=m.end();it++){
		   cout<<it.first<<' '<<it.second<<'\n';
    }
	return 0;
}

特别鸣谢woaiwo大佬

原文