View Code of Problem 36

#include<bits/stdc++.h>
using namespace std;   
int main(){
	int n;
	cin>>n;
	getchar();
	while(n--){
		char tmp[1010],c;
		int hao[100] = { };
		gets(tmp);
		int len = strlen(tmp);
		for(int i = 0;i<len;i++)hao[tmp[i]]++;
		for(int i = 65;i<=90;i++){
			if(hao[i]!=0)cout<<hao[i]<<(char)i;	
		}
		cout<<endl;
	}	
	return 0;
} 

Double click to view unformatted code.


Back to problem 36