Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstring>
- #include <iostream>
- #include <map>
- using namespace std;
- int main() {
- std::map<string, int> mp;
- int d = 0;
- string name;
- string a, b, c;
- while (cin) {
- cin >> a >> b >> c;
- name = a + " " + b + " " + c;
- cin >> d;
- mp[name, d] += d;
- if (!cin)
- break;
- }
- for (auto i = mp.begin(); i != mp.end(); ++i) {
- cout << i -> first << " " << i -> second << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement