Advertisement
a53

secventeneuniforme

a53
Jan 3rd, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream f("secventeneuniforme.in");
  4. ofstream g("secventeneuniforme.out");
  5.  
  6. int main()
  7. {
  8. int x,y,z,LC=2,LM=0;
  9. f>>x>>y;
  10. while(f>>z)
  11. {
  12. if(x==y||x==z||y==z)
  13. {
  14. if(LC>LM)
  15. LM=LC;
  16. LC=2;
  17. }
  18. else
  19. ++LC;
  20. x=y,y=z;
  21. }
  22. if(LC>LM)
  23. LM=LC;
  24. g<<LM;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement