Advertisement
Guest User

Untitled

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