Language: C++

int main()
{
	map<int, int> num;
	map<int, int>::iterator it;
	int i;
	char c;
	char s[1000000];
	while (cin.get(c)) {
		if (!isdigit(c)) {
			break;
		}

		i = 0;
		s[i++] = c;
		while ( cin.get(c) ) {
			if (!isdigit(c)) break;
			s[i++] = c;
		}
		s[i] = '\0';
		num[atoi(s)] --;

		i = 0;
		while ( cin.get(c) ) {
			if (!isdigit(c)) break;
			s[i++] = c;
		}
		s[i] = '\0';

		cin.ignore(0xff, '\n');
	}
	while (cin.get(c)) {
		if (!isdigit(c)) {
			break;
		}

		i = 0;
		s[i++] = c;
		while ( cin.get(c) ) {
			if (!isdigit(c)) break;
			s[i++] = c;
		}
		s[i] = '\0';
		num[atoi(s)] = abs(num[atoi(s)]) + 1;

		i = 0;
		while ( cin.get(c) ) {
			if (!isdigit(c)) break;
			s[i++] = c;
		}
		s[i] = '\0';

		cin.ignore(0xff, '\n');
	}
	for (it = num.begin(); it != num.end(); it++) {
		if ((*it).second > 0) cout<<(*it).first<<" "<<(*it).second<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'map' was not declared in this scope
    3 |         map<int, int> num;
      |         ^~~
a.cc:3:13: error: expected primary-expression before 'int'
    3 |         map<int, int> num;
      |             ^~~
a.cc:4:13: error: expected primary-expression before 'int'
    4 |         map<int, int>::iterator it;
      |             ^~~
a.cc:8:16: error: 'cin' was not declared in this scope
    8 |         while (cin.get(c)) {
      |                ^~~
a.cc:9:22: error: 'isdigit' was not declared in this scope
    9 |                 if (!isdigit(c)) {
      |                      ^~~~~~~
a.cc:16:30: error: 'isdigit' was not declared in this scope
   16 |                         if (!isdigit(c)) break;
      |                              ^~~~~~~
a.cc:20:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 |                 num[atoi(s)] --;
      |                 ^~~
      |                 enum
a.cc:20:21: error: 'atoi' was not declared in this scope
   20 |                 num[atoi(s)] --;
      |                     ^~~~
a.cc:24:30: error: 'isdigit' was not declared in this scope
   24 |                         if (!isdigit(c)) break;
      |                              ^~~~~~~
a.cc:31:16: error: 'cin' was not declared in this scope
   31 |         while (cin.get(c)) {
      |                ^~~
a.cc:32:22: error: 'isdigit' was not declared in this scope
   32 |                 if (!isdigit(c)) {
      |                      ^~~~~~~
a.cc:39:30: error: 'isdigit' was not declared in this scope
   39 |                         if (!isdigit(c)) break;
      |                              ^~~~~~~
a.cc:43:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   43 |                 num[atoi(s)] = abs(num[atoi(s)]) + 1;
      |                 ^~~
      |                 enum
a.cc:43:21: error: 'atoi' was not declared in this scope
   43 |                 num[atoi(s)] = abs(num[atoi(s)]) + 1;
      |                     ^~~~
a.cc:43:32: error: 'abs' was not declared in this scope
   43 |                 num[atoi(s)] = abs(num[atoi(s)]) + 1;
      |                                ^~~
a.cc:47:30: error: 'isdigit' was not declared in this scope
   47 |                         if (!isdigit(c)) break;
      |                              ^~~~~~~
a.cc:54:14: error: 'it' was not declared in this scope; did you mean 'i'?
   54 |         for (it = num.begin(); it != num.end(); it++) {
      |              ^~
      |              i
a.cc:54:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   54 |         for (it = num.begin(); it != num.end(); it++) {
      |                   ^~~
      |                   enum
a.cc:55:39: error: 'cout' was not declared in this scope
   55 |                 if ((*it).second > 0) cout<<(*it).first<<" "<<(*it).second<<endl;
      |                                       ^~~~
a.cc:55:77: error: 'endl' was not declared in this scope
   55 |                 if ((*it).second > 0) cout<<(*it).first<<" "<<(*it).second<<endl;
      |                                                                             ^~~~