Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("secventauniforma.in");
- ofstream g("secventauniforma.out");
- int main()
- { int n,x,mx=-1,k=0,i,a;
- f>>n;
- while(f>>x)
- { if(x!=n)
- k=1;
- else
- k++;
- if(k>=mx)
- {
- mx=k;
- a=x;
- }
- n=x;
- }
- g<<mx<<endl;
- for(i=1; i<=mx; i++)
- {
- g<<a<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement