Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("crescatoare.in");
- ofstream fout("crescatoare.out");
- int n,i,a,b,lc,lmax;
- int main()
- {
- fin>>n;
- fin>>a;
- lmax = 1;
- lc = 1;
- for ( i = 1; i < n; i++ )
- {
- fin>>b;
- if ( b == a )
- {
- lc++;
- if ( lc > lmax )
- lmax = lc;
- }
- else
- {
- a = b;
- lc = 1;
- }
- }
- fout<<lmax;
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement