Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int f(char *s)
- {
- int m = 0, c = 0;
- while (*s) {
- c++;
- if (*s != *(s + 1)) {
- if (c > m)
- m = c;
- c = 0;
- }
- s++;
- }
- return m;
- }
- int main()
- {
- char *s = "aaaaaaaaabbbbbbbbbbbbbaaaagggdfaaaaaaaaaaarwetrwe";
- int r = f(s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement