#include<iostream>
using namespace std;
int main()
{
char str[50];
char tmp;
int count = 0;
cin>>str;
char *p = str;
tmp = *p;
count++;
while(*(++p)!='\0')
{
if(*p == tmp)//如果当前读入的字符和正在统计的一样,那么出现次数要++
{
count++;
continue;
}
cout<<tmp<<count;//如果读入一个新的字符,就要把正在统计的字符频率输出,接下来开始统计新读入的字符的出现次数
tmp = *p;
count = 1;
}
cout<<tmp<<count;//因为读到'\0'循环退出,最后一个连续的字符序列没有输出,所以在这里追加输出
getchar();
getchar();
return 0;
}