freq of characters in a string:
#include
#include
using namespace std;
void freq(string s){
int fre[26]={0};
char result;
int len=s.length();
for(int i=0;i<len;++i){
fre[s[i]-'a']++;
}
for(int i=0;i<26;++i){
if(fre[i]>0){
result=(char)(i + 'a');
cout<<result<<fre[i];
}
}
}
int main() {
string s;
getline(cin,s);
freq(s);
return 0;
}