Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main () {
- int v[1000001], x = 0, c = 0, i = 1, max = 0, j;
- ifstream f("bac.txt");
- while(f >> v[i]) {
- if(v[i] % 2 == 0)
- c++;
- else {
- if(max < c)
- max = c;
- c = 0;
- }
- i++;
- }
- f.close();
- c = 0;
- for(j = 1; j < i; j++) {
- if(v[j] % 2 == 0)
- c++;
- else
- c = 0;
- if(max == c)
- x++;
- }
- cout << x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement