Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. long long a,b,c[100000],h,i,maximym;
  5. int main()
  6. {
  7. h=1;
  8. maximym=0;
  9. while(cin>>a){
  10. if(a==0)break;
  11. else b++;
  12. c[b]=a;
  13. }
  14. for(i=1; i<=b-1; i++){
  15. if(c[i]==c[i+1])h++;
  16. else{
  17. if(h==0){
  18. cout<<0;
  19. }
  20. else if(h>maximym)maximym=h;
  21. h=1;
  22. }
  23. }
  24. cout << maximym << endl;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement