Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define Maior(a,b) (a>b)?a:b
- int main() {
- int Size, i, j, Count=1, Result=1;
- scanf("%d", &Size);
- int Num[Size];
- for(i = 0; i < Size; i++) scanf("%d", &Num[i]);
- for(i = 0; i < Size; i++) {
- if(Num[i] == Num[i+1]) Count++;
- else {
- Result = Maior(Count, Result);
- Count = 1;
- }
- }
- printf("%d", Result);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement