Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("secventapara.in");
- ofstream g("secventapara.out");
- int num,scv,scvmax,contor;
- int main()
- {
- while (f >> num)
- {
- if (num%2==0)
- {
- ++scv;
- }
- else
- {
- if (scv>scvmax) { scvmax=scv; contor=1; }
- else
- {
- if (scv==scvmax) ++contor;
- }
- scv=0;
- }
- }
- if (scv>scvmax) { scvmax=scv; contor=1; }
- else
- {
- if (scv==scvmax) ++contor;
- }
- g << contor;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement