Advertisement
a53

Secv10

a53
May 13th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream fin("secv10.in");
  4. ofstream fout("secv10.out");
  5.  
  6. int main()
  7. {
  8. int n,x,l=0,lmax=0,c=0;
  9. fin>>n;
  10. for(int i=1;i<=n;++i)
  11. {
  12. fin>>x;
  13. if(x%10==0)
  14. {
  15. ++l;
  16. if(l>lmax)
  17. lmax=l,c=1;
  18. else
  19. if(l==lmax)
  20. ++c;
  21. }
  22. else
  23. l=0;
  24. }
  25. fout<<lmax<<' '<<c;
  26. return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement