#include <stdio.h>
#include <string.h>
int main() {
char s;
char txt[40000]="x",str[200];
scanf("%s", str);
int n = strlen(str),count=0;
strcat(txt, str);
for (int i = 1; i <= n-1; i++) {
scanf("%s", str);
strcat(txt, str);
}
printf("%d ", n);
s = txt[1];
for (int i = 1; i < strlen(txt); i++) {
if (s == txt[i]) count++;
else {
printf("%d ", count);
s = txt[i];
count = 1;
}
}
printf("%d", count);
return 0;
}
真的就不明白我哪里不对了,求求大佬解答