Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int foo(char asd[100]){
- int i=1, j, max=1;
- for(j=1;j<=strlen(asd);j++){
- if(asd[j]==asd[j-1]){
- i++;
- if(i>max)
- max=i;
- }
- else
- i=1;
- }
- return max;
- }
- int main()
- {
- char line[100];
- while (gets(line) != NULL)
- printf("%d\n", foo(line));
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement