#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
void main()
{
char str[1024];
int num[1024] = {0};
scanf("%s", str);
for (int i = 0; i < strlen(str); i++) //判断是否除了字母以外还有其他字符如果有则删去
{
while (str[i]<'A' || str[i]>'z' )
{
for (int j = i; j < strlen(str); j++)
{
str[j] = str[j + 1];
}
if (str[i] == '\0')
{
break;
}
}
}
int i = 0;
while (str[i]!='\0')
{
int count = 1;
int j = i;
while (str[j] == str[j + 1])
{
count++;
j++;
}
num[i] = count;
printf("%c", str[i]);
printf("%d", num[i]);
i += count;
}
//printf("%s", str);
system("pause");