Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main() {
- char str[256];
- int i, j, count, length, counter[10], max;
- gets(str);
- length = strlen(str);
- for(i = 0; i < length; i++)
- {
- for(count = 0, j = i; (str[j] >= 97 && str[j] <= 122) || (str[j] >= 65 && str[j] <= 90); count++, j++);
- counter[count - 1]++;
- for(i = 0; i < 10; i++)
- {
- printf("%d-", counter[i]);
- }
- printf("\n");
- i = j;
- }
- for(i = 1, max = counter[0]; i < 10; i++)
- {
- if(counter[i] > max)
- {
- max = counter[i];
- }
- }
- for(i = 0; i < 10; i++)
- {
- if(counter[i] == max)
- printf("%d ", i+1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment