Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long a,b,c[100010],h,i,maximym;
- int main()
- {
- h=1;
- b=0;
- maximym=0;
- while(cin>>a){
- if(a==0)break;
- b++;
- c[b]=a;
- }
- for(i=2; i<=b; i++){
- if(c[i]==c[i-1])h++;
- else{
- if(h>maximym)maximym=h;
- h=1;
- }
- }
- cout << maximym << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement