View Code of Problem 36

#include "stdlib.h"
#include "algorithm"
#include "iostream"
#include <cstdio>
#include "string"
#include <iomanip>
#include <map>
#include <set>
#include "math.h"
using namespace std;
map<char, int> mp;
set<string> st;

int main() 
{
	int t; cin >> t; 
	getchar();
	while (t--)
	{
		char a=48; int x[26] = { 0 };
		while (a!='\n')
		{
			a = getchar();
			int i = a - 'A';
			x[i]++;
		}
		for (int i = 0; i < 26; i++)
		{
			a = i + 'A';
			if (x[i] != 0)cout << x[i] << a;
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36