Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("BAC.txt");
- int main()
- {
- long long x,nr=0,cont=0,k=0;
- while (f>>x && x%2!=0)
- {
- nr++;}
- k=nr+1;
- while (f>>x)
- { k++;
- if(x%2==0) cont=0;
- else cont++;
- }
- cout<<k-(nr+cont);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement