题解 | #合并表记录#
合并表记录
https://www.nowcoder.com/practice/de044e89123f4a7482bd2b214a685201
#include <iostream> #include <map> using namespace std; int main() { int n; cin >> n; map<int,int> m; for (int i = 0; i < n; ++i){ int a,b; cin >> a >> b; m[a] += b; } for (auto i :m) { cout << i.first << ' ' << i.second << endl; } }#23届找工作求助阵地##C++##零基础学习C++#