Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("secventeneuniforme.in");
- ofstream g("secventeneuniforme.out");
- int main()
- {
- int x,y,z,LC=2,LM=0;
- f>>x>>y;
- while(f>>z)
- {
- if(x==y||x==z||y==z)
- {
- if(LC>LM)
- LM=LC;
- LC=2;
- }
- else
- ++LC;
- x=y,y=z;
- }
- if(LC>LM)
- LM=LC;
- g<<LM;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement