#include <iostream> #include <map> using namespace std; int main() { int n; cin >>n; map<int, int> table; for(int i = 0;i<n;i++) { int index,value; cin>>index>>value; table[index] += value; } //使用迭代器输出 for(const auto& entry : table) { cout<<entry.firs...