8 char outputs[1001] =
"\0";
10 unsigned int currentCharLength = 0;
11 char currentChar = inputs[0];
12 for (
unsigned int i = 0; i <= strlen(inputs); i++) {
13 if (inputs[i] == currentChar) {
17 outputs[strlen(outputs)] = currentChar;
19 sprintf(outputs + strlen(outputs),
"%u", currentCharLength);
20 outputs[strlen(outputs)] =
'\0';
21 currentChar = inputs[i];
22 currentCharLength = 1;
26 printf(
"%s\n", outputs);
29 printf(
"%.3f", (
double)strlen(outputs) / strlen(inputs));