Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int N, x, vetor[10000], ca=1, y=0, result=0;
- scanf("%d", &N);
- if(N<1 || N>10000) return 0;
- for(x=0; x<N; x++) {
- scanf("%d", &vetor[x]);
- }
- for(x=0; x<N; x++) {
- y++;
- if(vetor[x] == vetor[y]) { ca++;}
- else if(ca>result) {result=ca; ca=1;}
- else ca=1;
- }
- printf("%d", result);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement